Content deleted Content added
→Conflict with the Law of Demeter: entire section removed. It makes a claim "according to ... |
Add "redirects here" template |
||
(9 intermediate revisions by 6 users not shown) | |||
Line 1:
{{short description|Design technique in object-oriented programming}}
{{Redirects here|Data-driven design|the optimization approach|Data-oriented design}}
{{primary sources|date=December 2012}}
'''Responsibility-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 (computer science)|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 [[Class (computer programming)|classes]] or [[Instance (computer science)|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.<ref name="Wirfs-Brock1989">{{cite journal|last1=Wirfs-Brock|first1=Rebecca|last2=Wilkerson|first2=Brian|title=Object-Oriented Design: A Responsibility-Driven Approach|journal=ACM SIGPLAN Notices|date=1989|volume=24|issue=10|page=74|doi=10.1145/74878.74885|
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)|Eiffel]] programming language. Even finer control of the visibility of even classes is available in the [[Newspeak (programming language)|Newspeak]] programming language.
==Overview==
Responsibility-driven design focuses on the objects as [https://www.cs.cmu.edu/~rbd/doc/nyquist/part4.html behavioral abstractions] which are characterized by their responsibilities. The [[Class-responsibility-collaboration card|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.<ref name="AnthonySimons">{{cite
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 [http://www.computerhope.com/jargon/d/distribs.htm distributed systems]. Similarly, it can help to design and maintain explanation facilities for [[cognitive
==Building blocks==
In their book ''Object Design: Roles, Responsibilities and Collaborations'',<ref name="ObjectDesign-entirebook">{{cite book|author1=Wirfs-Brock, Rebecca|author2=McKean, Alan|title=Object Design: Roles, Responsibilities, and Collaborations|date=2003|publisher=Addison-Wesley|___location=Indianapolis, IN|isbn=
* Application: A software application is referred to as a set of interacting objects.<ref name="ObjectDesign-page3"/>
Line 57 ⟶ 59:
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 [https://en.wiktionary.org/wiki/sub-system subsystems].
* Concept of Control : The responsibilities and collaborations among the classes.<ref name="Evaluating the effect of a delegated versus centralized control style on the maintainability of object-oriented software">{{cite journal|first1=Arisholm|last1 = Eric|first2 = Sjoberg|last2 =Dag I.K.|title=
* 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.<ref name="ObjectDesign-page196">{{harvnb |Wirfs-Brock|McKean|2002| pp=196 }}</ref>
* 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.
Line 125 ⟶ 127:
==Bibliography==
* [https://dx.doi.org/10.1145/74877.74885 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.
* {{cite book |author1=Wirfs-Brock, Rebecca |author2=McKean, Alan |title= Object Design: Roles, Responsibilities, and Collaborations |publisher= [[Addison Wesley]] |date=November 2002 |isbn= 978-0-201-37943-
[[Category:Object-oriented programming]]
|