GRASP 101
What does GRASP do?
GRASP helps us decide which responsibility should be assigned to which object or class, defining the blue prints for those objects.
GRASP Principles:
- Creator - Factory, Builder, Object Mother – what creates the object
- Information Expert - Single Responsiblitly principle, who has responsibility of what
- Low Coupling - dependent, used in one place, minimize dependency on other classes
- High Cohesion - all working to accomplish same goal, not one time use
- Controller - delagates the work and coordinates
- Indirection - avoids a direct coupling between two or more elements
- Polymorphism - many different implementations that respond the same, helps decide which object is responsible for handling diff elements.
- Protected Variations - immutablity, avoid conditions on types to let polymorphism do its thing, protect the way objects change in its controlled space
- Pure Fabrication - creating something out of the blue
–// //–
Written on October 2, 2019