Presentation is loading. Please wait.

Presentation is loading. Please wait.

GRASP (General Responsibility Assignment Software Patterns)

Similar presentations


Presentation on theme: "GRASP (General Responsibility Assignment Software Patterns)"— Presentation transcript:

1 GRASP (General Responsibility Assignment Software Patterns)
popo

2 GRASP: Designing Objects With Responsibilities
After identifying the requirements and create a domain model, Then add methods to the software classes, and Define the messaging between the objects to fulfill the requirements. Identify what methods belong where, and how the objects should interact, is important. This is the heart of what it means to develop an object-oriented system popo

3 GRASP: Designing Objects With Responsibilities
The GRASP patterns are a learning aid to help to understand essential object design. This approach used to design principles is based on patterns of assigning responsibilities. popo

4 GRASP: Responsibilities and Methods
The UML defines a responsibility which are related to the Actions of an object in terms of its behavior. Basically, these responsibilities are of two types: Knowing Doing popo

5 GRASP: Responsibilities and Methods
Knowing responsibilities of an object include: 1) knowing about private encapsulated data 2) knowing about related objects 3) knowing about things it can derive or calculate Doing responsibilities of an object include: 1) doing something itself, such as creating an object or doing a calculation 2) Initiating action in other objects 3) controlling and coordinating activities in other objects popo

6 GRASP: Responsibilities and Methods
Responsibilities are assigned to classes of objects during object design. For example, "a Sale is responsible for creating SalesLineltems" (a doing), or "a Sale is responsible for knowing its total" (a knowing). popo

7 GRASP: Responsibilities and Methods
A responsibility is not the same thing as a method, but methods are implemented to fulfill responsibilities. Responsibilities are implemented using methods that either act alone or collaborate with other methods and objects. popo

8 GRASP: Responsibilities and Interaction Diagrams
Within the UML artifacts, these responsibilities (implemented as methods) are considered in during the creation of interaction diagrams popo

9 GRASP: Responsibilities and Interaction Diagrams
The above fig indicates that Sale objects have been given a responsibility to create Payments, which is invoked with a makePayment message and handled with a corresponding makePayment method. interaction diagrams show responsibilities to objects. When created, decisions in responsibility assignment are made, which are reflected in what messages are sent to different classes of objects. popo


Download ppt "GRASP (General Responsibility Assignment Software Patterns)"

Similar presentations


Ads by Google