Recent from talks
Nothing was collected or created yet.
Responsibility-driven design
View on WikipediaResponsibility-driven design is a design technique in object-oriented programming, which improves encapsulation by using the client–server model. It focuses on the contract by considering the actions that the object is responsible for and the information that the object shares. It was proposed by Rebecca Wirfs-Brock and Brian Wilkerson.
Responsibility-driven design is in direct contrast with data-driven design, which promotes defining the behavior of a class along with the data that it holds. Data-driven design is not the same as data-driven programming, which is concerned with using data to determine the control flow, not class design.
In the client–server model they refer to, both the client and the server are classes or instances of classes. At any particular time, either the client or the server represents an object. Both the parties commit to a contract and exchange information by adhering to it. The client can only make the requests specified in the contract and the server must answer these requests.[1] Thus, responsibility-driven design tries to avoid dealing with details, such as the way in which requests are carried out, by instead only specifying the intent of a certain request. The benefit is increased encapsulation, since the specification of the exact way in which a request is carried out is private to the server.
To further the encapsulation of the server, Wirfs-Brock and Wilkerson call for language features that limit outside influence to the behavior of a class. They demand that the visibility of members and functions should be finely grained, such as in Eiffel programming language. Even finer control of the visibility of even classes is available in the Newspeak programming language.
Overview
[edit]Responsibility-driven design focuses on the objects as behavioral abstractions which are characterized by their responsibilities. The CRC-card modelling technique is used to generate these behavioral abstractions. The rest of the object structure including data attributes are assigned later, as and when required.[2] This makes the design follow type hierarchy for inheritance which improves encapsulation and makes it easier to identify abstract classes. It can also group the classes together based on their clients which is considered a unique ability.
A good object-oriented design involves an early focus on behaviors to realize the capabilities meeting the stated requirements and a late binding of implementation details to the requirements. This approach especially helps to decentralize control and distribute system behavior which can help manage the complexities of high-functionality large or distributed systems. Similarly, it can help to design and maintain explanation facilities for cognitive models, intelligent agents, and other knowledge-based systems.[3]
Building blocks
[edit]In their book Object Design: Roles, Responsibilities and Collaborations,[4] the authors describe the following building blocks that make up responsibility-driven design.
- Application: A software application is referred to as a set of interacting objects.[5]
- Candidates: Candidates or candidate objects are key concepts in the form of objects described on CRC cards. They serve as initial inventions in the process of object design.[6]
- Collaborations: A collaboration is defined as an interaction of objects or roles (or both).[5]
- CRC Cards: CRC stands for Candidates, Responsibilities, Collaborators. They are index cards used in early design for recording candidates.[7] These cards are split up into an unlined and a lined side.
- Content of lined side: On this side the candidate's name, its responsibilities and its collaborators are recorded.[7]
- Content of unlined side: On this side the candidate's name, its purpose in the application, stereotype roles and anything worthwhile such as the names of roles in patterns it participates in are recorded.[7]
- Hot Spots: Hot Spots are points in the application where variations occur. They are recorded using Hot Spot Cards.[8]
- Hot Spot Cards: Hot Spot Cards are used for recording variations with just enough detail so you can discriminate important difference. Similar to CRC cards, these are also created from index cards.[8] These cards consist of:
- Hot Spot Name
- General description of the variation
- At least two specific examples where the variation occurs
Objects
[edit]Objects are described as things that have machine-like behaviors that can be plugged together to work in concert. These objects play well-defined roles and encapsulate scripted responses and information.[5]
- Object Neighborhoods: Another term for subsystem.[9] It is a logical grouping of collaborators.[9]
- Responsibilities: A responsibility is an obligation to perform a task or know information.[5] These are further categorized according to their usage scenario.
- Public Responsibilities: Public responsibilities are the responsibilities an object offers as services to others and the information it provides to others.[10]
- Private Responsibilities: Private responsibilities are the actions an object takes in support of public responsibilities.[10]
- Subresponsibilities: Sometimes, a large or complicated responsibility is split up into smaller ones called subresponsibilities.[11] They are further categorized based on what they do.
Roles
[edit]Object role refers to an exterior view of what general service is offered by the object. It is a set of related responsibilities.[5] It can be implemented as a class or an interface. Interface, however, is the preferred implementation as it increases flexibility by hiding the concrete class which ultimately does the work.[12]
Role Stereotypes: Role stereotypes are simplified roles that come with predefined responsibilities.[13] There are several categories.
- Controller: Object implementing this role makes decisions and closely directs the action of other objects.[13]
- Coordinator: This role reacts to events by delegating tasks to others.[13]
- Information Holder: Information holder knows and provides information.[13]
- Information Provider: A slight variation of an information holder is the information provider, which takes a more active role in managing and maintaining information. This distinction can be used if a designer needs to get more specific.[14]
- Interfacer: This role transforms information and requests between distinct parts of an application.[13] It is further divided into more specific roles.
- External Interfacer: External interfacer communicates with other applications rather than its own.[14] It is mainly used for encapsulating non-object-oriented APIs and does not collaborate a lot.[15]
- Internal Interfacer: Also called intersystem interfacer.[14] It act as a bridge between object neighborhoods.[15]
- User Interfacer: User interfacer communicates with users by responding to events generated in the UI and then passing them on to more appropriate objects.[14][15][16]
- Service Provider: This role performs work and offers computing services.[14]
- Structurer: This role maintains relationships between objects and information about those relationships.[14]
Control style
[edit]An important part in the responsibility-driven design process is the distribution of control responsibilities that results in developing a control style. A control style is concerned about the control flow between subsystems.
- Concept of Control : The responsibilities and collaborations among the classes.[17]
- Control Centers : An important aspect of developing a control style is the invention of so-called control centers. These are places where objects charged with controlling and coordinating reside.[18]
- Control Style Variations : A control style comes in three distinct variations. These are not precise definitions though since a control style can be said to be more centralized or delegated than another.
Centralized control style
[edit]This control style inflicts a procedural paradigm on the structure of the application and places major-decision making responsibilities in only a few objects or a single object.
- Types
- Call-return model : The control of the objects in the application is in hierarchical way. Control starts at root and moves downwards. It is used in a sequential model.
- Manager model : The control of the objects in the application is in with only one object. Generally, it is implemented in concurrent models. It can also be implemented in sequential model using case statement.
- Advantages
- Application logic is in one place.
- Disadvantages
- Control logic can get overly complex
- Controllers can become dependent on information holders' contents
- Objects can become coupled indirectly through the actions of their controller
- The only interesting work is done in the controller
- When to use
When decisions to be made are few, simple, and related to a single task.
Delegated control style
[edit]A delegated control style lies in between a centralized and dispersed control style. It passes some of the decision making and much of the action to objects surrounding a control center. Each neighboring object has a significant role to play. It can also be called as event driven model, where the control is delegated to the object requesting it to process the event.
- Types[reference]
- Broadcast model : An event is broadcast to all objects in the application. The object which can handle the event can acquire the control.
- Interrupt-driven model : There will be the interrupt handler to process the interrupt and passes to some object to process it.
- Advantages
- It is easy to understand.
- Though there is an external coordinator, Objects can be made smarter to know what they are supposed to do and can be reused in other applications.
- Delegating coordinators tend to know about fewer objects than dominating controllers.
- Dialogs are higher-level.
- It is easy to change as changes typically affect fewer objects.
- It is easier to divide design work among team members.
- Disadvantages
- Too much distribution of responsibility can lead to weak objects and weak collaborations
- When to use
When one wants to delegate work to objects that are more specialized.
Clustered control style
[edit]This control style is a variation of the centralized control style wherein control is factored among a group of objects whose actions are coordinated.[19] The main difference between a clustered and delegated control style is that in a clustered control style, the decision making objects are located within a control center whereas in a delegated control style they are mostly outside.[20]
Dispersed control style
[edit]A dispersed control style does not contain any control centers. The logic is spread across the entire population of objects, keeping each object small and building in as few dependencies among them as possible.[21]
- Advantages
- None
- Disadvantages
- When you want to find out how something works, you must trace the sequence of requests for services across many objects
- Not very reusable because no single object contributes much
- When to use
Never.
Preferred control style
[edit]After extensive results of experiments conducted, only the senior management has the necessary skills to make use of delegated control style and centralized control style benefits programmers. There is no context mentioned about the mid-level employees.[17]
References
[edit]- ^ Wirfs-Brock, Rebecca; Wilkerson, Brian (1989). "Object-Oriented Design: A Responsibility-Driven Approach". ACM SIGPLAN Notices. 24 (10): 74. doi:10.1145/74878.74885.
- ^ Anthony J. H. Simons; Monique Snoeck; Kitty Hung (1998). "Design Patterns as Litmus Paper to Test the Strength of Object-Oriented Methods". Oois'98. pp. 129–147. CiteSeerX 10.1.1.130.8713. doi:10.1007/978-1-4471-0895-5_10. ISBN 978-1-85233-046-0.
- ^ Steven R. Haynes; Isaac G. Councill; Frank E. Ritter (2004). "Responsibility-Driven Explanation Engineering for Cognitive Models".
- ^ Wirfs-Brock, Rebecca; McKean, Alan (2003). Object Design: Roles, Responsibilities, and Collaborations. Indianapolis, IN: Addison-Wesley. ISBN 978-0201379433.
- ^ a b c d e Wirfs-Brock & McKean 2002, pp. 3
- ^ Wirfs-Brock & McKean 2002, pp. 58
- ^ a b c Wirfs-Brock & McKean 2002, pp. 61
- ^ a b Wirfs-Brock & McKean 2002, pp. 72
- ^ a b Wirfs-Brock & McKean 2002, pp. 17
- ^ a b Wirfs-Brock & McKean 2002, pp. 126
- ^ a b c Wirfs-Brock & McKean 2002, pp. 168
- ^ Wirfs-Brock & McKean 2002, pp. 340
- ^ a b c d e Wirfs-Brock & McKean 2002, pp. 4
- ^ a b c d e f Wirfs-Brock & McKean 2002, pp. 93
- ^ a b c Wirfs-Brock & McKean 2002, pp. 165
- ^ Wirfs-Brock & McKean 2002, pp. 164
- ^ a b Eric, Arisholm; Dag I.K., Sjoberg (2004). "Evaluating the effect of a delegated versus centralized control style on the maintainability of object-oriented software". IEEE Transactions on Software Engineering. 30 (8): 521–534. doi:10.1109/TSE.2004.43. S2CID 6396127.
- ^ Wirfs-Brock & McKean 2002, pp. 196
- ^ Wirfs-Brock & McKean 2002, pp. 197
- ^ Wirfs-Brock & McKean 2002, pp. 213
- ^ Wirfs-Brock & McKean 2002, pp. 30
Bibliography
[edit]- Object-oriented design: a responsibility-driven approach. In Conference Proceedings on Object-Oriented Programming Systems, Languages and Applications (New Orleans, Louisiana, United States, October 2–06, 1989). OOPSLA '89. ACM Press, New York, NY, 71-75.
- Wirfs-Brock, Rebecca; McKean, Alan (November 2002). Object Design: Roles, Responsibilities, and Collaborations. Addison Wesley. ISBN 978-0-201-37943-3.
Responsibility-driven design
View on GrokipediaOverview
Definition and Principles
Responsibility-driven design (RDD) is an object-oriented design methodology that conceptualizes objects as collections of responsibilities rather than as data structures with attributes, prioritizing the behaviors and services objects provide over their internal state. This approach shifts the focus from "what an object is" to "what an object does," encouraging designers to identify obligations that objects fulfill in response to messages from other objects, such as performing computations or delegating tasks. Introduced by Rebecca Wirfs-Brock and Brian Wilkerson in 1989, RDD emerged as a deliberate departure from data-driven design paradigms that emphasize early implementation details. At its core, RDD adheres to the client-server model for object interactions, where objects act as clients issuing requests or as servers fulfilling them, thereby promoting clear separation of concerns. Encapsulation is achieved through contracts—formal specifications of an object's responsibilities that outline expected services and information exchanges without exposing implementation details, which helps maintain flexibility and reusability.[1] Responsibilities are defined as cohesive units of behavior, encompassing both knowledge an object maintains and the operations it supports, ensuring that each object handles a focused set of obligations.[1] A key principle of RDD is the pursuit of low coupling and high cohesion by assigning responsibilities in a way that minimizes dependencies between objects while maximizing the internal relatedness of each object's duties.[1] This assignment process involves analyzing scenarios to determine which objects should respond to events, fostering designs where objects collaborate effectively without unnecessary interconnections. Techniques like CRC cards can aid in initially identifying these responsibilities during design exploration.[1]Historical Context
Responsibility-driven design (RDD) originated in 1989 when Rebecca Wirfs-Brock and Brian Wilkerson presented their paper "Object-oriented design: a responsibility-driven approach" at the OOPSLA '89 conference, introducing it as a novel method for object-oriented software design.[5] In this foundational work, they proposed RDD to address shortcomings in prevailing data-driven design practices, which often prioritized an object's internal data structure over its external behavior and interactions.[5] The approach was inspired by the client-server model, envisioning objects as collaborative entities where each fulfills specific responsibilities in response to requests, thereby enhancing encapsulation and modularity from the outset.[5] During the 1990s, RDD gained significant traction through academic and professional workshops, particularly those led by Wirfs-Brock, and the publication of influential texts that elaborated its application. The 1990 book Designing Object-Oriented Software by Wirfs-Brock, Wilkerson, and Lauren Wiener provided a comprehensive framework for employing RDD in practical software development, emphasizing iterative design processes and behavioral modeling.[6] This was further refined in the early 2000s with Object Design: Roles, Responsibilities, and Collaborations (2003) by Wirfs-Brock and Alan McKean, which expanded on roles and collaborations as core elements, offering advanced techniques for designing robust object systems.[7] RDD developed as a direct counterpoint to early object-oriented programming challenges, particularly data-centric methods in languages like Smalltalk, where designs frequently centered on data representation at the expense of clear behavioral boundaries, leading to fragile implementations.[5] By focusing on responsibilities, RDD promoted a behavioral perspective that aligned with emerging ideas in contract-based programming, as seen in Eiffel's support for fine-grained visibility and assertions to enforce object interactions.[5] Following the 2003 publication, RDD experienced limited formal advancements in dedicated literature, yet its principles have been informally incorporated into agile software development practices since the 2010s, supporting collaborative and iterative object design in dynamic environments. As of 2025, RDD continues to influence modern methodologies, including integrations with Domain-Driven Design (DDD) and discussions in conferences such as the "Responsibility Driven Design Revisited" talk at NDC Oslo 2025.[4][8]Core Building Blocks
Objects and Responsibilities
In responsibility-driven design (RDD), objects are viewed as autonomous behavioral entities characterized by their capabilities and actions rather than their internal state or data attributes. This perspective shifts the focus from what an object is to what it does, treating objects as active participants that fulfill specific obligations within a system. Each object is bound by a contract of responsibilities, which defines a cohesive set of behaviors it must perform in response to messages from other objects, ensuring clear expectations for interactions.[1] Assigning responsibilities to objects involves heuristics to determine whether an object should handle a task independently or delegate it to collaborators. A key guideline is the "do it yourself" versus "ask for help" decision: if an object possesses the necessary information or capability to complete a responsibility on its own, it does so to maintain encapsulation and simplicity; otherwise, it requests assistance from another object better suited to the task. For instance, an object acting as an information holder manages and provides access to its own data, such as a song object knowing its title and duration, while a service provider performs actions on behalf of others, like a player object that renders audio without needing to store the song details itself. These assignments promote low coupling and high cohesion by ensuring responsibilities align with an object's inherent expertise.[1][3] Encapsulation in RDD reinforces this by hiding an object's internal state and implementation details, exposing only the interfaces that fulfill its responsibilities. This approach allows objects to evolve internally without affecting dependent components, enhancing reusability across different contexts while preventing unintended dependencies on hidden data. By prioritizing message-based interactions over direct state access, RDD objects remain flexible and maintainable.[1] Unlike data-driven design, which centers on modeling static attributes and relationships, RDD emphasizes dynamic behavior, collaborations, and the fulfillment of responsibilities through object interactions, leading to more adaptable and intent-focused systems.[1] Responsibilities within an object may be grouped into roles to facilitate analysis of its contributions in broader collaborations.[9]Roles and Collaborators
In responsibility-driven design (RDD), roles represent abstract characterizations of behavior that define an object's purpose within a collaboration, independent of any specific class implementation. A role encapsulates a cohesive set of responsibilities that an object assumes to contribute to the system's functionality, allowing designers to focus on what an object does rather than how it is internally structured.[9] This abstraction enables multiple objects to play the same role interchangeably across different contexts, fostering a design approach where behavior patterns are reusable without tying them to concrete classes. For instance, various objects might fulfill a "financial asset" role in a banking system, regardless of their underlying data structures or algorithms.[9][1] Common role stereotypes in RDD provide designers with archetypal patterns to guide responsibility assignment. These include:- Controller: Manages decision-making and directs the flow of actions among other objects, often centralizing control in response to events.[9]
- Coordinator: Orchestrates interactions by reacting to events and delegating tasks to ensure cooperative work among objects.[9]
- Information Holder: Stores and provides access to data or knowledge, maintaining facts without performing complex computations.[9]
- Service Provider: Executes specialized tasks or operations, offering services that other objects rely upon to complete their responsibilities.[9]
- Interactor: Handles transformations or exchanges of information between system components, such as user interfaces or external integrations.[9]
Design Techniques
CRC Cards
Class-Responsibility-Collaboration (CRC) cards serve as a core technique in responsibility-driven design (RDD) for identifying and documenting the responsibilities of objects and their interactions. These cards, typically 4x6-inch index cards or their digital equivalents, are divided into three sections: the class name at the top, a list of responsibilities on the left side, and collaborators on the right side. Responsibilities are concise verb-phrase descriptions of what the class knows or does, such as maintaining data or performing actions, while collaborators are other classes with which it exchanges messages to fulfill those responsibilities.[10][1] Invented by Ward Cunningham and Kent Beck in 1989 as a teaching tool for object-oriented thinking, CRC cards were adapted for RDD to emphasize behavioral modeling over structural hierarchies.[10][11] The process of using CRC cards involves collaborative brainstorming sessions where a team starts by identifying candidate classes from domain requirements. For each class, participants assign responsibilities and note collaborators, iteratively refining them through scenario simulations. In these simulations, team members physically pick up cards to role-play active objects, "flipping" them to indicate message passing and revealing how objects collaborate to achieve system behaviors; this often leads to splitting classes, adding new ones, or adjusting responsibilities as dependencies emerge.[10][1] The low-tech nature of the cards allows for rapid iteration without software tools, making them suitable for early design phases.[10] CRC cards offer several advantages as a design tool in RDD, including their simplicity and portability, which foster team collaboration and shared understanding without requiring programming expertise. They enable the early detection of hidden dependencies and inconsistencies by simulating real-time interactions, promoting a focus on object behaviors rather than premature implementation details. Additionally, the tangible format encourages creative exploration and gradual revelation of design complexity.[10][11] To illustrate, consider designing a library management system. A CRC card for the Book class might include responsibilities such as checking availability and storing metadata, with collaborators like Catalog to query inventory status.| Class | Responsibilities | Collaborators |
|---|---|---|
| Book | Check availability Store title and author | Catalog |
