Die Suche ergab 448 Treffer

von eichberg
5. Dez 2017 14:10
Forum: Software Engineering - Design and Construction
Thema: Exercise 6 - Eclipse Plugin
Antworten: 2
Zugriffe: 390

Re: Exercise 6 - Eclipse Plugin

thx for pointing it out.

BTW it is also possible to just add it once to your global sbt configuration. Afterwards, you can always use sbt eclipse for all projects.
von eichberg
4. Dez 2017 15:51
Forum: Software Engineering - Design and Construction
Thema: Ex 5.1.2 - params is a list?
Antworten: 2
Zugriffe: 281

Re: Ex 5.1.2 - params is a list?

It doesn't make a difference. From the JLS (9.7.1. Normal Annotations) https://docs.oracle.com/javase/specs/jls/se9/html/jls-9.html#jls-9.6 : If the element type is an array type, then it is not required to use curly braces to specify the element value of the element-value pair. If the element value...
von eichberg
4. Dez 2017 15:46
Forum: Software Engineering - Design and Construction
Thema: Ex. 5.1.2
Antworten: 5
Zugriffe: 498

Re: Ex. 5.1.2

I think the most difficult part of this exercise is to understand what should we do :wink: . So is that means we should make an annotation above push method in class Stack like: class Stack{ ... public static XXX violatingValue() { return XXX; } @ViolatingValueFactory(name="violatingValue") public ...
von eichberg
4. Dez 2017 15:43
Forum: Software Engineering - Design and Construction
Thema: Exercise 5 task 1.3
Antworten: 2
Zugriffe: 286

Re: Exercise 5 task 1.3

Just one very small addition: Java (as said in the very first exercise) erases all generic types... I.e., class X<V>{ V doIt(V v){...} } is (effectively and independent of the binding of V): class X<V>{ Object doIt(Object o){...} } if you now have a subclass class Y extends X<Integer> then the metho...
von eichberg
4. Dez 2017 15:36
Forum: Software Engineering - Design and Construction
Thema: Ex 5.1.2 typo in exercise sheet
Antworten: 1
Zugriffe: 190

Re: Ex 5.1.2 typo in exercise sheet

Thx - will be changed next round!
von eichberg
4. Dez 2017 15:33
Forum: Archiv
Thema: Ex 5.2 - InsufficientDocumentation about non-overridable methods...
Antworten: 2
Zugriffe: 411

Re: Ex 5.2 - InsufficientDocumentation about non-overridable methods...

Even a final (non-overridable) method which calls another (instance) method ( target ) generally has to document self-use. E.g., let's assume we want to implement an InstrumentedHashSet which counts additions and let's assume that the addAll method defined by the superclass HashSet is final ; now – ...
von eichberg
4. Dez 2017 15:14
Forum: Software Engineering - Design and Construction
Thema: Ex 5.2 - InsufficientDocumentation
Antworten: 2
Zugriffe: 251

Re: Ex 5.2 - InsufficientDocumentation

In general, I highly(!!!) recommend to only use private state. However, if you have a non-private instance field you should document the contract (the invariant) related to the field where you define the field. (It may be necessary to update the field in a future subclass in a new method which does ...
von eichberg
1. Dez 2017 09:16
Forum: Software Engineering - Design and Construction
Thema: Ex. 5.1.2
Antworten: 5
Zugriffe: 498

Re: Ex. 5.1.2

Anyway, what is "// has to annotate (it at all) "push"" on the exercise paper in the code supposed to mean? ... we have a typo; let's try again: // annotate - if necessary – this method ("push") And did you notice that on lecture 4.1 slide. 20 the notes are cut off? (There is only written: 'These i...
von eichberg
29. Nov 2017 14:41
Forum: Software Engineering - Design and Construction
Thema: Exercise 5 Task 1.2 - which class
Antworten: 3
Zugriffe: 407

Re: Exercise 5 Task 1.2 - which class

in exercise 5 task 1.2, are we assumed to have the compile time error in a subclass of Stack? Or should this error occur in IntMap, e.g. because it uses Stack? Actually it doesn't matter who is using (calling) Stack in this case as long as the "value (if it exists)" is causing the client code (whic...
von eichberg
28. Nov 2017 16:20
Forum: Software Engineering - Design and Construction
Thema: Ex. 5.1.2
Antworten: 5
Zugriffe: 498

Re: Ex. 5.1.2

1. How can it be possible, that a run time value leads to a compile time error? Certain constants (related to reference values) can cause such errors (see the slides which discuss the "Fragile Base Class Problem"). 2. I was able to write code so I get a warning "methods ... are inherited with the s...
von eichberg
26. Nov 2017 20:25
Forum: Software Engineering - Design and Construction
Thema: LSP and self-consistency
Antworten: 2
Zugriffe: 320

Re: LSP and self-consistency

In the bottom of slide 7 of LSP lecture, it is written This model is self-consistent. What self-consistency means in this context please? When you do not consider possible clients (in particular those that just use the base type) and just take a look at the given two classes in isolation everything...
von eichberg
24. Nov 2017 17:00
Forum: Software Engineering - Design and Construction
Thema: Ex 4.1 non-null parameters
Antworten: 6
Zugriffe: 924

Re: Ex 4.1 non-null parameters

We are only talking about LSP violations if a subclass of violates a contract defined by a superclass . If the implementation of a method violates the contract directly defined by itself/for the class as whole, then we clearly also have a problem (typically called a Bug) - but we do not (yet) have a...
von eichberg
24. Nov 2017 16:41
Forum: Software Engineering - Design and Construction
Thema: ex04: Contract named "left", in function named "e1"
Antworten: 1
Zugriffe: 194

Re: ex04: Contract named "left", in function named "e1"

This is an unfortunate IDE misconfiguration issue...

The parameters should be called left and right or the JavaDoc should be updated to refer to e1 and e2. I.e., the mapping is as specified in your case.
von eichberg
24. Nov 2017 16:38
Forum: Software Engineering - Design and Construction
Thema: Ex 4 - When two methods should have same output, which is wrong?
Antworten: 1
Zugriffe: 242

Re: Ex 4 - When two methods should have same output, which is wrong?

In case of the exercise, every method that violates the contract (which is explicitly defined in the code of the exercise or inherited from a superclass(!) ) should be annotated. If the implementation of a method directly violates its own contract then it is considered a bug and not an LSP violation...

Zur erweiterten Suche