grasp
Contents
GRASP
Information expert
- Assign responsibility to the class that has the information needed to fulfill it.
Low Coupling, High Cohesion
Creator
In general, Assign class B
the responsibility to create object A
if one, or preferably more, of the following apply
- Instances of
B
contain or compositely aggregate instances ofA
- Instances of
B
record instances ofA
- Instances of
B
closely use instances ofA
- Instances of
B
have the initializing information for instances ofA
and pass it on creation
Low Coupling, Factory pattern