GRASP is short for General Responsibility Assignment Software Patterns. GRASP is a design pattern in object-oriented software development. It’s a tool for software developers that provides a way to solve organizational problems. Also, it offers a common way when talking about abstract concepts. This design pattern sets responsibilities for objects and classes in object-oriented program design
In GRASP (General Responsibility Assignment Software Patterns) when working with object-oriented programming, it classifies problems and the solutions together into a pattern. Thus making them well defined where they can be applied in other similar instances. Grasp has nine different patterns for classes and objects that helps make it clear to show the responsibilities. The nine patterns are:
– Controller: Assigns the responsibility of dealing with system events.
– Creator: Most common in object-oriented system, which class is responsible for creating objects.
– High Cohesion: Evaluative pattern that attempts to keep objects focused, manageable and understandable.
– Indirection: Pattern that supports low coupling and reuses potential between two elements.
– Information Expert: The most basic principle – if we do not have the data we need, we would not be able to meet the requirement and assign responsibility.
– Low Coupling: A measure of how strong one element is connected to, has knowledge of, or relies on another element.
– Polymorphism: Responsible for defining the variation of behaviors based on the type is assigned to.
– Protected Variations: A pattern that protects elements from the variations on other elements by wrapping the focus with an interface and using polymorphism to create various implementations.
– Pure Fabrication: A class that does not represent a concept in the problem domain.
I chose to write about GRASP (General Responsibility Assignment Software Patterns) because it is a part of our curriculum which we will be learning in this class. Since I have written about DRY (Don’t Repeat Yourself) and YAGNI (You Ain’t Gonna Need It), it made sense to continue researching about patterns and learning more about it. As I have mentioned many times before, I plan on becoming a full-stacked developer. Learning about these different types of patterns and what each of them do will help me as a developer become more knowledgeable and more efficient when it comes to coding.
A good blog I found when researching this topic that I suggest to read and learn more about GRASP is:
http://www.kamilgrzybek.com/design/grasp-explained/.
This Blog is very useful and has many examples of the nine patterns I mentioned.
From the blog CS@Worcester – Michael's Developer Blog by michaelchaau and used with permission of the author. All other rights reserved by the author.