Responsibility-Driven Design
- Responsibility implies Non-Interference
- Works better for programming-in-the-large
vs. programming-in-the-small
- Where software is built by team
and responsibility must be shared
- Where the management of details
and COMMUNICATION are the main problems
Tasks in RDD
- Work through scenarios
- Identify components
- Components have a small well-defined
set of responsibilities
- Components should interact with
other components to the minimal extent possible
- CRC Cards-Recording Responsibility
Component, Responsibility, Collaborator (CRC) Cards
Why CRC Cards?
- Give Components a Physical Representation
- The What/Who Cycle
- Documentation
Components and Behavior
- Postpone Decisions
- Prepare for Change
- Primary objective: Changes should affect
as few components as possible
- Try to predict likely sources of change
and isolate those
- Try to isolate and reduce hardware
dependencies
- Reduce coupling
- Record major decisions
Interaction Diagrams
- Replacement for "I am..."
notation
Coupling and Cohesion
- Cohesion is the degree to which
the responsibilities of a single component form a meaningful unit
- Coupling describes the relationship
between software components
- Goal: Reduce coupling, increase
cohesion
Parnas' Principles: Interface and Implementation
The developer of a software component must provide the intended
user with all the information needed to make effective use of
the services provided by the component,
and should provide no other information
The developer of a software component must be provided with all
the information necessary to carry out the given responsibilities
assigned to the component, and should be provided with no
other information