Die Suche ergab 40 Treffer
- 12. Feb 2018 16:13
- Forum: Archiv
- Thema: Qs to exe10 solution
- Antworten: 5
- Zugriffe: 1459
Re: Qs to exe10 solution
Hi, Take the example in the lecture trait Rectangle { def setWdith def setHeight def area } class Square extends Rectangle { def setWidth def setHeight } It violates LSP. And I think it also violates ISP, I can do it like trait shape { def area() } class Rectangle extends shape{def setWdith, def set...
- 12. Feb 2018 12:48
- Forum: Archiv
- Thema: Qs to exe10 solution
- Antworten: 5
- Zugriffe: 1459
Re: Qs to exe10 solution
Hi, Thanks for your comprehensive answers. In my 4th question, if we change the definition of Edge like class Edge(var node1, GraphElement, var node2: GraphElement) extends GraphElement{...} Then can we consider edge as a composite? Because now we can flexibly change the left part and right part of ...
- 10. Feb 2018 14:45
- Forum: Archiv
- Thema: Qs to exe10 solution
- Antworten: 5
- Zugriffe: 1459
Qs to exe10 solution
Hi all, I am redoing the exes and found in exe10 there are something not so clear to me. 1)In the build() of taskbuilder, it has: def addDependency(task: Task): TaskBuilder = { require(dependence.isEmpty) dependence = Some(task) this } So is that means if the dependence is defined, then this functio...
- 3. Feb 2018 20:58
- Forum: Archiv
- Thema: sbt submit error
- Antworten: 1
- Zugriffe: 327
sbt submit error
Hi, I have found a strange error when I try to submit. I annotate @Product and @Command above Command trait like this: @Command @Product trait Command { def exec(): Unit def undo(): Unit } However, when I submit, it says trait Command is abstract, can not be instantiated; trait Product is abstract, ...
EX11
Hi, I got some questions here: 1)What does copy method do? In which scenario it should be used? 2) So the whole Formula class works like val f = new Formula var nextPlaceHolder = f.findNextPlaceholder.get //root val add = new Add(Placeholder(),Placeholder()) val + = f.replace(nextPlaceHolder,add) va...
EX10
Hi, There are still some questions: 1) If I call DependentTaskA.markdone(), so it only reassign the done time of DenpendentTaskA (none -> some())? or I should also markdone() the dependent task that DependentTaskA contains? How about billableTask? 2) I got a feeling that the third task should be imp...
- 25. Jan 2018 20:44
- Forum: Archiv
- Thema: EX10 Task1
- Antworten: 5
- Zugriffe: 1238
Re: EX10 Task1
That could be a solution but really weird design0b101101101 hat geschrieben: ↑25. Jan 2018 16:24I have the feeling (although no proof) that duration is not calculatable but only settable and may start with zero if not set.
- 24. Jan 2018 14:31
- Forum: Archiv
- Thema: EX10 Task1
- Antworten: 5
- Zugriffe: 1238
Re: EX10 Task1
Hi,
in the runner method
task4 has no duedate and can not get the duration(duedate - startdate). It's a typo or I miss something?
in the runner method
Code: Alles auswählen
list = new TaskBuilder("task4").addPriority('A').addRate(10.0).build() :: list
- 23. Jan 2018 22:11
- Forum: Archiv
- Thema: EX10 Task1
- Antworten: 5
- Zugriffe: 1238
EX10 Task1
Hi, I have some questions regarding task1: 1) The ordering of DependentTask and BillableTask. We don't know which method(addRate and addDependency) is called first, so it could be DependentTask (SimpleTask, BillableTask) or BillableTask(SimpleTask, DependentTask). Can we assume that BillableTask is ...
- 20. Jan 2018 11:33
- Forum: Archiv
- Thema: EX09 Task1
- Antworten: 1
- Zugriffe: 536
EX09 Task1
Hi everyone, 1)Should each node maintain a list of parents? That means a node N1 can be firstly added into an edge E1, and then both N1 and E1 is added to a composite called C1, should we set N1's parent like List(E1,C1) or just C1? 2)what does getSize actually do? 3)What is the position of a compos...
- 20. Jan 2018 11:05
- Forum: Software Engineering - Design and Construction
- Thema: Ex09 - "numberOfElements"
- Antworten: 2
- Zugriffe: 360
Re: Ex09 - "numberOfElements"
Actually I have the same confusion regarding to this problem.
In the assignment sheet, it is stated "arrange all nodes in a circle." So I think only nodes should be considered. Then it needs a type check and looks really like a bad design.
Best
In the assignment sheet, it is stated "arrange all nodes in a circle." So I think only nodes should be considered. Then it needs a type check and looks really like a bad design.
Best
- 18. Jan 2018 10:05
- Forum: Software Engineering - Design and Construction
- Thema: EX09
- Antworten: 4
- Zugriffe: 742
EX09
Hello, I have some questions with ex09 Q1: Does Edge really should extend GraphElement? Because when you want to draw edge, you need to call getPosition. However the getPosition method defined in the GraphElement only return a tuple with two ints. I think if we want to getPosition of an edge, at lea...
- 13. Jan 2018 07:40
- Forum: Software Engineering - Design and Construction
- Thema: EX08 Task2
- Antworten: 1
- Zugriffe: 226
EX08 Task2
Hi! I am confused about the decorator pattern in this exercise. Here are some my understandings, I am not sure if it is right or not. 1. In decorator pattern, a concrete decorator MUST hold an instance of component interace and have the same method signature as the component interface, it can have a...
- 11. Jan 2018 16:47
- Forum: Software Engineering - Design and Construction
- Thema: EX08 Task4
- Antworten: 2
- Zugriffe: 304
Re: EX08 Task4
Thx!
- 11. Jan 2018 09:19
- Forum: Software Engineering - Design and Construction
- Thema: EX08 Task4
- Antworten: 2
- Zugriffe: 304
EX08 Task4
Hi, I am annotating the template method and find the following error. For example if I annotate like this: @PrimitiveOperation protected abstract Iterator<String> getKeysInternal(); @TemplateMethod("getKeysInternal") protected Iterator<String> getKeysInternal(String prefix) { return new PrefixedKeys...