GRASP’ing for Good Design

I hear it’s not all that uncommon for great software engineers to keep the principles of GRASP (General Responsibility Assignment Software Patterns) in mind while carrying out Object Oriented Design (OOD).

Here, I’ve gone ahead and summarised these points into convenient shortened captions. Do feel free to look up and read Craig Larman’s 2005 text, including topics on OOD and OOA (analysis).

Pattern Caption
Creator “Container” object creates “constrained” objects.
Information Expert “Delegate responsibility to the class with most information to fulfil it.”
Low Coupling “Change in one class has low impact on other classes.” – “High reuse potential.”
Controller “First object to receive and delegate responsibilities.”
High Cohesion “Breaking programs into classes and subsystems.” – “Responsibilities for element are highly focused and strongly related.”
Indirection “Mediation between 2 elements is the responsibility of a third component.” E.g. controller in MVC.
Polymorphism “Variation of behaviour based on type” …
Protected Variations “Protect reusable elements by wrapping with interface and polymorphism — the focus of instability.”
Pure Fabrication “A service class” – Used to achieve low coupling, high cohesion, reuse. “Does not correspond to a concept in problem domain.”

Further reference: 
Larman, Craig (2005) [2004]. Applying UML and Patterns – An Introduction to Object-Oriented Analysis and Design and Iterative Development (3rd ed.). New Jersey: Prentice Hall. ISBN 0-13-148906-2.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.