GRASP (object-oriented design): Difference between revisions

Content deleted Content added
clean up (except for the middle section which is still a mess)
Line 30:
The creation of objects is one of the most common activities in an object-oriented system. Which class is responsible for creating objects is a fundamental property of the relationship between objects of particular classes.
 
Problem: Who creates object <code>A</code>?<br>
Solution: In general, Assign class <code>B</code> the responsibility to create object <code>A</code> if one, or preferably more, of the following apply:
* Instances of <code>B</code> contain or compositely aggregate instances of <code>A</code>