Search code examples
grasp

What is the difference between GRASP information expert and GRASP cohesion?


Both concepts are very similar it is hard to tell which is which.

Please give an example of how you would differentiate them.


Solution

  • All GRASP concepts are linked, so you should consider them all together:

    1. "information expert" - question is "Which object should have needed behavior?" (Please see http://en.wikipedia.org/wiki/Domain-driven_design) like one of the answers for this question.
    2. "cohesion" - question is "How many different behaviors object have" http://en.wikipedia.org/wiki/GRASP_(object-oriented_design)

    You should not learn these concepts without coding practice, write code/make refactoring - and you will get it.