Information Expert (GRASP)

GRASP Pattern: Information Expert

 * Name | **Information Expert** |
 * Problem | What is a general principle of assigning responsibilities to objects? |
 * Solution | Assign a responsibility to the class that has the necessary information. |

The pattern Information Expert (often abbreviated to Expert) is one of the most basic responsibility assignment principles in object design.

Suppose objects need to be able to reference a particular Square, given its name. Who should be responsible for knowing a Square, given a key? This is a //knowing// responsibility, but Expert also applies to //doing//.

A responsibility needs information for its fulfillment. For example, information about other objects, an object's own state, the world around an object, information that object can derive, and so forth.

In the example of a Square, to retrieve and present any one Square, given its name, some object must know (have the information) about all the Square objects. Since the object Board will aggregate all the Square objects, the Board has the information necessary to fulfill this responsibility.

The next GRASP principle, Low Coupling, explains why Expert is a useful, core principle of OO design.