Die Suche ergab 26 Treffer

von VSchü
15. Jul 2018 13:57
Forum: Software Engineering - Design and Construction
Thema: Exam Task Identify Design Pattern
Antworten: 10
Zugriffe: 856

Re: Exam Task Identify Design Pattern

If you only have one single decorator (InterpretedStatement), you do not necessarily need an abstract Decorator class. And InterpretedStatement has in fact an aggregation to the Component (Statement): case class InterpretedStatement(val result: Option[Int], val original: Statement ) extends Statement
von VSchü
15. Jul 2018 13:05
Forum: Software Engineering - Design and Construction
Thema: Exam Task Identify Design Pattern
Antworten: 10
Zugriffe: 856

Re: Exam Task Identify Design Pattern

InterpretedStatement is a transparent layer around other Statements that changes the behaviour of interpret, isn't it? Or did I misunderstand you?
von VSchü
15. Jul 2018 10:00
Forum: Software Engineering - Design and Construction
Thema: Linearization Steps - Query Related to Exam Solution Method
Antworten: 15
Zugriffe: 852

Re: Linearization Steps - Query Related to Exam Solution Method

The intermediate steps are NOT the same! But you already showed that they are the same.. Lin(C) = {C, Lin(A) >> Lin(B)} = {C, A, B, AnyRef, Any} = {C, Lin(A) >> Lin(B) >> Lin(AnyRef)} = Lin(C) So you can add Lin(AnyRef) or leave it out, it really makes no difference. Even {C, Lin(AnyRef) >> Lin(A) ...
von VSchü
14. Jul 2018 19:32
Forum: Software Engineering - Design and Construction
Thema: Linearization Steps - Query Related to Exam Solution Method
Antworten: 15
Zugriffe: 852

Re: Linearization Steps - Query Related to Exam Solution Method

Code: Alles auswählen

Lin(AnyRef) = {AnyRef, Any} 
which will be added either way by one of the other linearizations. So it makes no difference if you include it at that point or not, therefore you can leave it out. On the other hand

Code: Alles auswählen

Lin(A) = {A}
would be incomplete, therefore you have to include it there.
von VSchü
14. Jul 2018 18:34
Forum: Software Engineering - Design and Construction
Thema: Linearization Steps - Query Related to Exam Solution Method
Antworten: 15
Zugriffe: 852

Re: Linearization Steps - Query Related to Exam Solution Method

In principle, everything from A to F also extends AnyRef and Any, so you would have to add it to each intermediate linearization result. For example: Lin(A) = {A, AnyRef, Any} But the concatination removes it from the first half either way, it will always be at the end: Lin(C) = {C, Lin(A) >> Lin(B)...
von VSchü
14. Jul 2018 18:27
Forum: Software Engineering - Design and Construction
Thema: Invisible objects in signal from event
Antworten: 1
Zugriffe: 223

Re: Invisible objects in signal from event

Without exactly knowing the answer, I would guess this is what Prof. Salvaneschi meant when he sad, that one should not have side effects (like printing) inside signals. Could you verify if this still happens when you outsource the printing to something like

Code: Alles auswählen

printer.changed += { println(_) }
?
von VSchü
14. Jul 2018 14:31
Forum: Software Engineering - Design and Construction
Thema: Exam Task Identify Design Pattern
Antworten: 10
Zugriffe: 856

Re: Exam Task Identify Design Pattern

Nah, he meant you need to identify only let's say 4/5 or 5/6 patterns to get full points, not that there would be in absolute numbers be more patterns than points. Regarding Decorator Pattern: Statement is Component, InterpretedStatement is Decorator/ConcreteDecorator, Return and Assignment are Conc...
von VSchü
14. Jul 2018 13:30
Forum: Software Engineering - Design and Construction
Thema: Exam Task Identify Design Pattern
Antworten: 10
Zugriffe: 856

Re: Exam Task Identify Design Pattern

It's 14 points, not 14 patterns. I guess InterpretedStatement is a decorator, so there's Decorator Pattern. I think together with yours that's all I found and I wasn't even sure if Composite counts as it's missing all of the child management. :? Does anyone know which patterns are considered to be c...
von VSchü
14. Jul 2018 12:09
Forum: Software Engineering - Design and Construction
Thema: Mid-Term Exam WS 15/16 Task 1d)
Antworten: 5
Zugriffe: 958

Re: Mid-Term Exam WS 15/16 Task 1d)

No. val f: (Seq[MyClass]) => Boolean = f1;f2;f3;f4;f5;f6 actually means: val f: (Seq[MyClass]) => Boolean = f1 f2 f3 f4 f5 f6 You only assign f1 to f (which works as expected) and just output the values of f2 to f6. When you actually assign each one to f, you get exactly the results predicted in the...
von VSchü
12. Jul 2018 15:57
Forum: Software Engineering - Design and Construction
Thema: Exam WS 15/16 - Question 2 - c)
Antworten: 3
Zugriffe: 327

Re: Exam WS 15/16 - Question 2 - c)

You can refer to slide 25 of 6.3-DecoratorPattern. Essentially you can write something like trait Component class A extends Component trait Decorator extends Compenent val a = new A with Decorator to create an object of class A and mixin trait Decorator (in other words, statically decorate A with De...
von VSchü
11. Jul 2018 12:37
Forum: Software Engineering - Design and Construction
Thema: ex04: anyone remember why OCP is violated in this exercise?
Antworten: 4
Zugriffe: 419

Re: ex04: anyone remember why OCP is violated in this exercise?

I don't see how that would affect the LSP. But I guess if you abstain from default implementations, the OCP problem gets even worse as you have to change all the concrete visitors.
von VSchü
10. Jul 2018 20:00
Forum: Software Engineering - Design and Construction
Thema: ex04: anyone remember why OCP is violated in this exercise?
Antworten: 4
Zugriffe: 419

Re: ex04: anyone remember why OCP is violated in this exercise?

To cite Design Patterns by Gamma et al., p. 336: 3. Adding new ConcreteElement classes is hard. The Visitor pattern makes it hard to add new subclasses of Element. Each new ConcreteElement gives rise to a new abstract operation on Visitor and a corresponding implementation in every ConcreteVisitor c...
von VSchü
24. Mai 2018 22:31
Forum: Software Engineering - Design and Construction
Thema: Ex03 First tick
Antworten: 4
Zugriffe: 247

Re: Ex03 First tick

The scheduling is already implemented, so I would say we have no influence on that and dont need to worry about the details. Just make the step function emmit the event.
von VSchü
22. Mai 2018 09:07
Forum: Software Engineering - Design and Construction
Thema: Signature of .changed
Antworten: 4
Zugriffe: 183

Re: Signature of .changed

Ugh, ok. Thanks, got it working now. It's still pretty unsatisfying as I don't see why one would want to have the second parameter ("Struct type used for the propagation of the signal" according to code comment, in practice I always get "ParRP") in the first place.
von VSchü
22. Mai 2018 08:49
Forum: Software Engineering - Design and Construction
Thema: Events and Signals: Best ways to test
Antworten: 1
Zugriffe: 177

Re: Events and Signals: Best ways to test

There is an eclipse plugin that visualizes the dependency graph and shows how value changes propagate.

Zur erweiterten Suche