GRASP Patterns Overview
What are GRASP Patterns?
They describe fundamental principles of object design and responsibility assignment, expressed as patterns.After identifying your requirements and creating a domain model, then add methods to the software classes, and define the messaging between the objects to fulfill the requirements.
The GRASP patterns are a learning aid to help one understand essential object design, and apply design reasoning in a methodical, rational, explainable way. This approach to understanding and using design principles are based on patterns of assigning responsibilities.
Responsibilities and Methods
The UML defines a responsibility as "a contract or obligation of a classifier". Responsibilities are related to the obligations of an object in terms of its behavior. Basically, these responsibilities are of the following two types:- knowing
- doing
- doing something itself, such as creating an object or doing a calculation
- initiating action in other objects
- controlling and coordinating activities in other objects
- knowing about private encapsulated data
- knowing about related objects
- knowing about things it can derive or calculate
POS (Point Of Sale) application is used to explain all the GRASP Patterns.
Let's understand the POS(Point Of Sale) application briefly and then apply GRASP Patterns to POS Application.
Point of Sale (POS) application
Let's consider Point of Sale (POS) application: a Brief overview of POS application.- Application for a shop, restaurant, etc. that registers sales.
- Each sale is of one or more items of one or more product types and happens at a certain date.
- A product has a specification including a description, unitary price, and identifier.
- The application also registers payments (say, in cash) associated with sales.
- A payment is for a certain amount, equal or greater than the total of the sale.
Let's discuss five GRASP patterns. There is a separate Post for each GRASP Pattern
Comments
Post a Comment