GRASP (General Responsibility Assignment Software Patterns)

GRASP is a software design pattern that assigns responsibility for a given behavior to a specific class. It is often used in object-oriented programming to improve the modularity and flexibility of a system.

There are nine GRASP patterns:

1. Information Expert
2. Creator
3. Low Coupling
4. High Cohesion
5. Controller
6. Indirection
7. Polymorphism
8. Pure Fabrication
9. Protected Variations

What is GRASP in software architecture?

GRASP is a set of software engineering principles that can be applied during the design of a software system. The acronym GRASP stands for General Responsibility Assignment Software Principles. The nine principles that make up GRASP are:

1. Information Expert
2. Creator
3. Low Coupling
4. High Cohesion
5. Polymorphism
6. Controller
7. Indirection
8. Pure Fabrication
9. Protected Variations

The principle of "Information Expert" states that an object should be responsible for the data that it contains. The principle of "Creator" states that an object should be responsible for creating other objects that it needs. The principle of "Low Coupling" states that objects should be loosely coupled, meaning that they should be independent of each other. The principle of "High Cohesion" states that objects should be highly cohesive, meaning that they should be tightly coupled. The principle of "Polymorphism" states that objects should be able to be replaced by other objects without affecting the correctness of the program. The principle of "Controller" states that an object should be responsible for controlling the flow of the program. The principle of "Indirection" states that an object should not be directly dependent on another object, but should instead be dependent on an abstract representation of that object. The principle of "Pure Fabrication" states that an object should not be directly dependent on another object, but should instead be How many grasp patterns are there? There is no definitive answer to this question as it depends on how you define a grasp pattern. However, a reasonable estimate would be that there are at least a few hundred different grasp patterns that can be used for various tasks.

Why would you use grasp patterns when designing a system using object-oriented design?

There are a number of reasons why you might use grasp patterns when designing a system using object-oriented design. One reason is that grasp patterns can help you to identify the key objects in a system and the relationships between them. This can be particularly helpful when you are trying to understand a complex system. Another reason is that grasp patterns can help you to design objects that are more reusable and easier to maintain. What is GRASP used for? GRASP is a software design pattern that provides a solution to the problem of how to create objects in object-oriented programming. It is designed to help programmers create objects that are easy to understand and work well together.

Which GRASP principle talks about what should be responsible? The GRASP principle that talks about what should be responsible is the "Information Expert" principle. This principle states that the class that contains the data or information that is needed to perform a task should be responsible for performing that task.