Responsibility Driven Design

Object Design Rebecca Wirfs-Brock, Alan McKean

Objects are not just simple bundles of logic and data. They are responsible members of an object community.

Responsibility Driven Design: Core Definitions

TermDefinition
An applicationa set of interacting objects
An objectan implementation of one or more roles
A rolea set of related responsibilities
A responsibilityan obligation to perform a task or know information
A collaborationan interaction of objects or roles (or both)
A contractan 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 StereotypeDescription
Information holderknows and provides information
Structurermaintains relationships between objects and information about those relationships
Service providerperforms work and, in general, offers computing services
Coordinatorreacts to events by delegating tasks to others
Controllermakes decisions and closely directs others’ actions
Interfacertransforms information and requests between distinct parts of the system