EX06 - Scenario 3

Moderatoren: pmueller, SE - Design and Construction

emod02
Neuling
Neuling
Beiträge: 9
Registriert: 27. Apr 2018 19:35

EX06 - Scenario 3

Beitrag von emod02 » 13. Jun 2018 00:46

Hi,

the method we should annotate as fragile with a violated design principle using the FragileChange Annotion should only be the addAll Method?
If so, how should the method definition look like in the @FragileChange annotaion?
I mean the name and the return type of @MethodDef are pretty clear. But as you wrote in 1.1, only primitive types are allowed in this annotaion. And I think the type "Map<? extends K, ? extends V>" is not a primitive type to use in the paramter "params" of @MethodDef. :?

Thanks for your answers

pmueller
Moderator
Moderator
Beiträge: 87
Registriert: 25. Jan 2018 11:14

Re: EX06 - Scenario 3

Beitrag von pmueller » 13. Jun 2018 10:04

Hi,

you can use Map.class instead of Map<...>.
The constraint regarding the primitives only relates to the primitives and their respective Wrapper classes, i.e. you should use int.class instead of Integer.class etc.. You may use any other reference class that you think is correct.
In addition you should annotate the class, not the addAll method.

Best,
Patrick

bafnai
BASIC-Programmierer
BASIC-Programmierer
Beiträge: 126
Registriert: 13. Apr 2011 06:36

Re: EX06 - Scenario 3

Beitrag von bafnai » 14. Jun 2018 07:43

This is the default for the @FragileChange annotation:

Code: Alles auswählen

@FragileChange(method = @MethodDef, time = null, violatdDesignPrinciple = null)
What exactly are we supposed to enter for "method". Is it just @MethodDef(name = "addAll")?
Or are we supposed to enter the name of the method of Map.class that would cause the problems in case the addAll methods would be added?

pmueller
Moderator
Moderator
Beiträge: 87
Registriert: 25. Jan 2018 11:14

Re: EX06 - Scenario 3

Beitrag von pmueller » 14. Jun 2018 09:28

Hi,
bafnai hat geschrieben:
14. Jun 2018 07:43
What exactly are we supposed to enter for "method". Is it just @MethodDef(name = "addAll")?
Or are we supposed to enter the name of the method of Map.class that would cause the problems in case the addAll methods would be added?
Since you neither know the implementation of IntMap.addAll nor Map.addAll, I don't see how you could definitely pinpoint the problem to a single other method, especially since this is only a potential violation.

Best,
Patrick

Antworten

Zurück zu „Software Engineering - Design and Construction“