Responsibility Driven Design
Responsibility Driven Design: Core Definitions
| Term | Definition |
|---|---|
| An application | a set of interacting objects |
| An object | an implementation of one or more roles |
| A role | a set of related responsibilities |
| A responsibility | an obligation to perform a task or know information |
| A collaboration | an interaction of objects or roles (or both) |
| A contract | an agreement outlining the terms of a collaboration |
Role
A role is a set of responsibilities that can be used interchangeably.
DHL, FedEx, UPS, Post, Airborne all have the same purpose
Sterotypes
These are the object role stereotypes from the same Responsibility-Driven Design framework.
- its good to stereotype objects, ignoring specifics of their behaviors and thinking about them at a higher level.
- oversimplifying and characterizing it, we can ponder the nature of an object’s role more easily.
Object Role Stereotypes
| Role Stereotype | Description |
|---|---|
| Information holder | knows and provides information |
| Structurer | maintains relationships between objects and information about those relationships |
| Service provider | performs work and, in general, offers computing services |
| Coordinator | reacts to events by delegating tasks to others |
| Controller | makes decisions and closely directs others’ actions |
| Interfacer | transforms information and requests between distinct parts of the system |
Objects are not just simple bundles of logic and data. They are responsible members of an object community.