Die Suche ergab 41 Treffer

von Assax
21. Jul 2015 22:10
Forum: Archiv
Thema: exam yesterday
Antworten: 5
Zugriffe: 3074

Re: exam yesterday

Overall I have to say it was a really fair exam in my opinion though I also lacked time to do the 15point implementation part because I did all the other tasks first. I found two questions of the pattern task a bit hard though I found four patterns: 1. Visitor (the obvious one, though somehow withou...
von Assax
20. Jul 2015 00:23
Forum: Archiv
Thema: Coding with Variance
Antworten: 14
Zugriffe: 4340

Re: Coding with Variance

It was explicitly stated on Thursday by Prof. Eichberg that DRAWING UML will not be part of the exam, however you should be able to read it.

I asked him how we should show our designs then in case of pattern and he said it is to be expected that we could write it in code.
von Assax
19. Jul 2015 17:50
Forum: Archiv
Thema: Coding with Variance
Antworten: 14
Zugriffe: 4340

Re: Coding with Variance

object main extends App { def run() = { var c = new Collection(new swapSorter(), 1,2,3,4) println (c.printCollection()) var u = c.sort println (u.printCollection()) } class Collection[+A](sorting: SortableCollection, contains: A*) { var sorter: SortableCollection = new swapSorter() def add[B >: A](...
von Assax
19. Jul 2015 15:29
Forum: Archiv
Thema: SPL Slides mistake?
Antworten: 1
Zugriffe: 927

SPL Slides mistake?

Hello I think there is a mistake in the SPL Set on the Slides 30 and 31. Mainly: ^ or(Search,{BFS, DFS}) Should this not be alternative since there is an XOR between BFS , Search and DFS, Search? This continous on the next slide: (BFS v DFS) <=> Search where it should be ((BFS,DFS) <=> Search) ^ !(B...
von Assax
18. Jul 2015 22:29
Forum: Archiv
Thema: Coding with Variance
Antworten: 14
Zugriffe: 4340

Re: Coding with Variance

Simply because it is explicitly mentioned: Assume that you have a _base_ class Collection[A] which is covariant in A ... This _base_ gives me enough clue that I have to extend from this Collection. Another suggestion is the name of asked trait "SortableCollection". I think what is meant was that yo...
von Assax
18. Jul 2015 21:36
Forum: Archiv
Thema: Coding with Variance
Antworten: 14
Zugriffe: 4340

Re: Coding with Variance

Can you please explain why you both extend the Collection in your Template / Strategy patterns? I've never seen this in any of their structures. I would have thought it was something like this: trait Sortable { def sort[B <: A](c: Collection[B]): Collection[B] = { ... compare((B,B)) ... } def compar...
von Assax
18. Jul 2015 13:36
Forum: Archiv
Thema: Coding with Variance
Antworten: 14
Zugriffe: 4340

Re: Coding with Variance

I asked this same question on friday to one of the assistants. He said that it should be Collection[+A] for the collection itself and in the interface for example the method signature should be sort[B<:A](c: Collection[B]): Collection[B] Note that you wouldnt define the sort method inside your colle...
von Assax
18. Jul 2015 12:46
Forum: Archiv
Thema: Hiding the details
Antworten: 13
Zugriffe: 1309

Re: Hiding the details

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. This still sounds the same to me =/ you want to hide details of 3rd party interface / class and adapting it ...
von Assax
18. Jul 2015 12:29
Forum: Archiv
Thema: Hiding the details
Antworten: 13
Zugriffe: 1309

Re: Hiding the details

Maybe I am misunderstanding your question but isn't this exactly what the adapter pattern is for? It is meant to adapt a third party interface in such a way that it is compatible to what you have and the client expects. Usually it is used in order to make a third party interface work with yours but ...
von Assax
17. Jul 2015 23:32
Forum: Archiv
Thema: Scala and the Cakepattern in exam.
Antworten: 0
Zugriffe: 437

Scala and the Cakepattern in exam.

Hello, in the reading this thursday Prof. Eichberg mentioned that the exam will not contain any in depth scala features like types if I remember correctly. Right now I am having a bit of a trouble to understand the smart home example because some of the naming is confusing me, the whole type thing a...
von Assax
17. Jul 2015 02:12
Forum: Archiv
Thema: Template Method & DIP
Antworten: 2
Zugriffe: 520

Re: Template Method & DIP

Why do you think so? Just judging by what the DIP says I wouldn't say so. In the template method there is nothind dependand on low level modules. You have an abstract class with the template method and other abstract methods and other classes extending that and implementing the abstract methods. Whe...
von Assax
15. Jul 2015 16:48
Forum: Archiv
Thema: Midterm exam: Variance
Antworten: 3
Zugriffe: 805

Re: Midterm exam: Variance

F1 won't work (Any > Boolean) F2 Will work as explained F3 Will not work, again Any > Boolean F4 will not work because MySubclass < Myclass, remember arguments are about contravariance! F5 will work, any > MyClass and Nothing < Boolean F6 will not work and this is tricky. Null is a subclass of every...
von Assax
15. Jul 2015 15:50
Forum: Archiv
Thema: Midterm exam: Variance
Antworten: 3
Zugriffe: 805

Re: Midterm exam: Variance

This is confusing at first but becomes rather easy once you carefully take a look at the LSP slides, specifically slide 23. f: T1 -> T2 f': T1' -> T2' f' <: f <=> T1 <: T1' and T2' <: T2 Where T1 and T2 can be seen as argument type and return type respectively. Think about what the sentence Standard...
von Assax
13. Jul 2015 13:49
Forum: Archiv
Thema: REScala Iterate documentation / slides difference
Antworten: 8
Zugriffe: 956

Re: REScala Iterate documentation / slides difference

From my personal experience (note I am a first time Scala user and never have done anything with it before neither have I ever got in touch with sbt previously) My biggest problem was how to get it running without falling back on the exercise files being given. First I downloaded REscala from the Ma...
von Assax
13. Jul 2015 00:09
Forum: Archiv
Thema: Last year's trial Exam, Strategy pattern: SortableCollection
Antworten: 1
Zugriffe: 641

Re: Last year's trial Exam, Strategy pattern: SortableCollec

Hello, I posted an answer to this question here. https://www.fachschaft.informatik.tu-darmstadt.de/forum/viewtopic.php?f=234&t=32681 I don't think the specifics of the compare and swap methods etc are relevant for this task. If I had to take a guess your direct usage of IntHandle by IntSortableColle...

Zur erweiterten Suche