Collaborations
All classes are written to fulfill a responsibility. Occasionally, a class is capable of fulfilling such responsibility on its own. In more elaborate systems, classes are written to communicate with other classes and/or objects to fulfill a single responsibility required by a client. It can then be said that each class/object collaborates to fulfill a single responsibility and may require several classes or objects to do so.
Finding collaborations is rather simple, as you already know the responsibilities of each object. What is left is to conceive which objects, if any, are required to aid each other in fulfilling such responsibilities.
As an example, let's assign the appropriate collaborations, if any, to your Shell object, as ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access