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 ...

Get AdvancED ActionScript 3.0: Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.