9. Hausübung/Aufgabe 4 (REP vs. CRP)
In der Lösung stehen folgende:
Folie 69: "REP: If a package contains classes that should be reused, then it should
not also contain classes that are not designed for reuse."
Folie 71: "CRP: The classes in a package are reused together. If you reuse
one of the classes in a package, you reuse them all."
Meine Meinung nach sind beide nur eine Prinzip, nämlich CRP.
In dem Buch von Martin Robert steht (in Package Cohesion Abschnitt):
"We do not want a reuser to find that a package consists of some classes that are needed, and others that are wholly inappropriate."
Von REP (Folie 69) können wir wie folgt verstehen:
"If a package contains classes that should be reused (for one reuser group), then it should
not also contain classes that are not designed for reuse (by this reuser group)."
If you (a reuser of any "reuser group") reuses one package by using one class of this package, you
will reuse the whole package (all classes in this package). Because you are now the user of the reuser group, which this package was designed for.
"The classes in a package are reused together (for one reuser group). If you reuse
one of the classes in a package, you reuse them all"
Es ist genau CRP (Folie 71).
Für REP-Definition von dem Buch:
"The Reuse/Release Equivalence Principle (REP): The granule of reuse is the granule of release."
kurze Übersetzung: was "reuse" wird muss auch "release" werden.
"REP states that the granule of reuse, a component, can be no smaller than the granule of release.
Anything that we reuse must also be released and tracked. It is not realistic for a developer to simply
write a class and then claim that it is reusable. Reusability comes only after a tracking system is in place and
offers the guarantees of notification, safety, and support that the potential reusers will need."
Hab ich da was falsch?