Die Suche ergab 25 Treffer

von Banashri
31. Jul 2015 10:29
Forum: Archiv
Thema: Post Exam Review
Antworten: 8
Zugriffe: 3729

Re: Post Exam Review

Grades are visible now in TuCan.
von Banashri
21. Jul 2015 18:52
Forum: Archiv
Thema: exam yesterday
Antworten: 5
Zugriffe: 2988

Re: exam yesterday

For me the real problem was about solving pattern detection and code writing because one entire page was used to print the problem statement and we had to go back to previous page every time we refer some class/trait/method names related to problem. That activity took some precious time away from me...
von Banashri
19. Jul 2015 16:14
Forum: Archiv
Thema: Closures vs java anonymous classes
Antworten: 3
Zugriffe: 1772

Re: Closures vs java anonymous classes

I can see 2 problems.

1. i variable cannot be modified in Java, as it allows to access only final variables for closures.
2. if (i == 50) return; Not possible to break out of loop or return a value as a result of the containing method from within the lambda in Java.
von Banashri
19. Jul 2015 12:20
Forum: Archiv
Thema: Mid Term exam, Topic 2 b) Design Review
Antworten: 4
Zugriffe: 2084

Mid Term exam, Topic 2 b) Design Review

Hi, Can anyone explain me how DIP violated in the UML diagram for DungeonGame? I cannot see any problem between relationship of Position and Character classes. Edited: If Position is a class, then direct use of it inside methods of Characters makes it dependent on low level details. Thus, DIP violat...
von Banashri
18. Jul 2015 20:12
Forum: Archiv
Thema: Coding with Variance
Antworten: 14
Zugriffe: 4245

Re: Coding with Variance

Almost same as yours! abstract class Collection[+A] trait SortableCollection[+A] extends Collection[A] { def compare[U](elem1: U, elem2: U): Boolean def sort[U >: A](c: Collection[U]): Collection[U] = { //use compare } } trait SortableCollection[+A] extends Collection[A] { def sort[U >:A](compare: (...
von Banashri
18. Jul 2015 18:42
Forum: Archiv
Thema: Coding with Variance
Antworten: 14
Zugriffe: 4245

Re: Coding with Variance

I found some rules on allowed Variance positions, finally. :D Covariant type parameters can be used as return types only: abstract class SomeClass[+A] { def someMethod(): A } is allowed. Workaround to use a covariant type in a method parameter type: abstract class SomeClass[+A] { def someMethod[B >:...
von Banashri
18. Jul 2015 13:36
Forum: Archiv
Thema: Hiding the details
Antworten: 13
Zugriffe: 1197

Re: Hiding the details

Client instantiates receiver object for the command object, which is to be set to invoker.
So, client does not know how the work is done by receiver.
von Banashri
18. Jul 2015 13:29
Forum: Archiv
Thema: Coding with Variance
Antworten: 14
Zugriffe: 4245

Coding with Variance

Hi All, I need some help in understanding variance. Consider following question: Sketch two designs for a generic SortableCollection trait in Scala that supports sorting. Assume that you have a base class Collection[A] which is covariant in A. The outcome of the sorting method should be a fresh coll...
von Banashri
18. Jul 2015 12:38
Forum: Archiv
Thema: Hiding the details
Antworten: 13
Zugriffe: 1197

Re: Hiding the details

Initially I thought of Adapter pattern. But the question states about hiding details of 3rd party library interface/classes. In Adapter, you adapt your existing interfaces/classes in order to use 3rd party libraries using Adapter. Using Command pattern, you can use 3rd party libraries inside receive...
von Banashri
18. Jul 2015 11:42
Forum: Archiv
Thema: Hiding the details
Antworten: 13
Zugriffe: 1197

Re: Hiding the details

Why builder?
In my opinion, it can be done using Command design pattern where invoker and receiver (3rd party application) are totally decoupled. Command is - DrawImage.
Correct me if I am wrong.
von Banashri
17. Jul 2015 09:07
Forum: Archiv
Thema: Scala Trait: Self Type
Antworten: 0
Zugriffe: 357

Scala Trait: Self Type

Hi All, I have been trying out writing some code on self types. And I could not find the answer of how I can use self type in the following code. class A class B trait AB extends A { this: B => } this: B => allows the trait AB to be mixed in with any classes which is the subclass of B. But I am alre...
von Banashri
12. Jul 2015 12:55
Forum: Archiv
Thema: RP2: LatestOption
Antworten: 2
Zugriffe: 482

Re: RP2: LatestOption

No. Not necessary. You can have a look into this code snippet. /** conversion function: latestOption **/ val e4 = new ImperativeEvent[Int] val s4: Signal[Option[Int]] = e4.latestOption e4(1) println("s4: " + s4.get) // prints Some(1) assert(s4.get == Some(1)) // true assert(s4.get == Option(1)) // t...
von Banashri
9. Jul 2015 18:55
Forum: Archiv
Thema: Confused with UML used
Antworten: 2
Zugriffe: 321

Re: Confused with UML used

Yes. I totally agree with your answer. :-)
von Banashri
8. Jul 2015 11:54
Forum: Archiv
Thema: Closure & Lambda
Antworten: 2
Zugriffe: 446

Re: Closure & Lambda

You would be able to get the answer from this link : https://en.wikipedia.org/wiki/Closure_% ... ramming%29
von Banashri
5. Jul 2015 09:55
Forum: Archiv
Thema: Visitor Pattern
Antworten: 8
Zugriffe: 575

Re: Visitor Pattern

Thank you so much for such a nice explanation. :-)

Zur erweiterten Suche