## EX06 - Scenario 3

Moderatoren: pmueller, SE - Design and Construction

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

### EX06 - Scenario 3

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.

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

### Re: EX06 - Scenario 3

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.

Best,
Patrick

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

### Re: EX06 - Scenario 3

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
Beiträge: 87
Registriert: 25. Jan 2018 11:14

### Re: EX06 - Scenario 3

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