GRASP (General Responsibility Assignment Software Patterns) popo
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
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
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
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
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
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
GRASP: Responsibilities and Interaction Diagrams Within the UML artifacts, these responsibilities (implemented as methods) are considered in during the creation of interaction diagrams popo
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