Die Suche ergab 40 Treffer

von tz33quvu
12. Feb 2018 16:13
Forum: Archiv
Thema: Qs to exe10 solution
Antworten: 5
Zugriffe: 1119

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...
von tz33quvu
12. Feb 2018 12:48
Forum: Archiv
Thema: Qs to exe10 solution
Antworten: 5
Zugriffe: 1119

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 ...
von tz33quvu
10. Feb 2018 14:45
Forum: Archiv
Thema: Qs to exe10 solution
Antworten: 5
Zugriffe: 1119

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...
von tz33quvu
3. Feb 2018 20:58
Forum: Archiv
Thema: sbt submit error
Antworten: 1
Zugriffe: 222

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, ...
von tz33quvu
1. Feb 2018 09:27
Forum: Archiv
Thema: EX11
Antworten: 1
Zugriffe: 497

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...
von tz33quvu
26. Jan 2018 09:08
Forum: Archiv
Thema: EX10
Antworten: 1
Zugriffe: 526

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...
von tz33quvu
25. Jan 2018 20:44
Forum: Archiv
Thema: EX10 Task1
Antworten: 5
Zugriffe: 1022

Re: EX10 Task1

0b101101101 hat geschrieben:
25. Jan 2018 16:24
I have the feeling (although no proof) that duration is not calculatable but only settable and may start with zero if not set.
That could be a solution but really weird design
von tz33quvu
24. Jan 2018 14:31
Forum: Archiv
Thema: EX10 Task1
Antworten: 5
Zugriffe: 1022

Re: EX10 Task1

Hi,
in the runner method

Code: Alles auswählen

list = new TaskBuilder("task4").addPriority('A').addRate(10.0).build() :: list
task4 has no duedate and can not get the duration(duedate - startdate). It's a typo or I miss something?
von tz33quvu
23. Jan 2018 22:11
Forum: Archiv
Thema: EX10 Task1
Antworten: 5
Zugriffe: 1022

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 ...
von tz33quvu
20. Jan 2018 11:33
Forum: Archiv
Thema: EX09 Task1
Antworten: 1
Zugriffe: 455

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...
von tz33quvu
20. Jan 2018 11:05
Forum: Software Engineering - Design and Construction
Thema: Ex09 - "numberOfElements"
Antworten: 2
Zugriffe: 263

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
von tz33quvu
18. Jan 2018 10:05
Forum: Software Engineering - Design and Construction
Thema: EX09
Antworten: 4
Zugriffe: 638

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...
von tz33quvu
13. Jan 2018 07:40
Forum: Software Engineering - Design and Construction
Thema: EX08 Task2
Antworten: 1
Zugriffe: 157

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...
von tz33quvu
11. Jan 2018 16:47
Forum: Software Engineering - Design and Construction
Thema: EX08 Task4
Antworten: 2
Zugriffe: 214

Re: EX08 Task4

Thx!
von tz33quvu
11. Jan 2018 09:19
Forum: Software Engineering - Design and Construction
Thema: EX08 Task4
Antworten: 2
Zugriffe: 214

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...

Zur erweiterten Suche