Responsibility-driven design

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 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

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

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

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.
      • Subordinate Responsibilities: These include the major steps in each subresponsibility.[11]
      • Sequencing Responsibilities: These refer to the sequencing of the execution of subordinate responsibilities.[11]

Roles

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

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

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

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

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

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

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

  1. ^ Wirfs-Brock, Rebecca; Wilkerson, Brian (1989). "Object-Oriented Design: A Responsibility-Driven Approach". ACM SIGPLAN Notices. 24 (10): 74. doi:10.1145/74878.74885.
  2. ^ 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.
  3. ^ Steven R. Haynes; Isaac G. Councill; Frank E. Ritter (2004). "Responsibility-Driven Explanation Engineering for Cognitive Models".
  4. ^ Wirfs-Brock, Rebecca; McKean, Alan (2003). Object Design: Roles, Responsibilities, and Collaborations. Indianapolis, IN: Addison-Wesley. ISBN 978-0201379433.
  5. ^ a b c d e Wirfs-Brock & McKean 2002, pp. 3
  6. ^ Wirfs-Brock & McKean 2002, pp. 58
  7. ^ a b c Wirfs-Brock & McKean 2002, pp. 61
  8. ^ a b Wirfs-Brock & McKean 2002, pp. 72
  9. ^ a b Wirfs-Brock & McKean 2002, pp. 17
  10. ^ a b Wirfs-Brock & McKean 2002, pp. 126
  11. ^ a b c Wirfs-Brock & McKean 2002, pp. 168
  12. ^ Wirfs-Brock & McKean 2002, pp. 340
  13. ^ a b c d e Wirfs-Brock & McKean 2002, pp. 4
  14. ^ a b c d e f Wirfs-Brock & McKean 2002, pp. 93
  15. ^ a b c Wirfs-Brock & McKean 2002, pp. 165
  16. ^ Wirfs-Brock & McKean 2002, pp. 164
  17. ^ 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.
  18. ^ Wirfs-Brock & McKean 2002, pp. 196
  19. ^ Wirfs-Brock & McKean 2002, pp. 197
  20. ^ Wirfs-Brock & McKean 2002, pp. 213
  21. ^ Wirfs-Brock & McKean 2002, pp. 30

Bibliography

Read other articles:

Henri Saivet Informasi pribadiNama lengkap Henri SaivetTanggal lahir 26 Oktober 1990 (umur 33)Tempat lahir Dakar, SenegalTinggi 1,75 m (5 ft 9 in)[1]Posisi bermain PenyerangInformasi klubKlub saat ini BordeauxNomor 20Karier junior1999–2002 Cergy Clos2002–2007 BordeauxKarier senior*Tahun Tim Tampil (Gol)2007– Bordeaux 41 (3)2011 → Angers (pinjaman) 18 (3)Tim nasional‡2005–2006 Prancis U-16 15 (8)2006–2007 Prancis U-17 21 (8)2007–2008 Prancis U-18 4 ...

 

Adas sowa Anethum graveolens TaksonomiDivisiTracheophytaSubdivisiSpermatophytesKladAngiospermaeKladmesangiospermsKladeudicotsKladcore eudicotsKladasteridsKladcampanulidsOrdoApialesFamiliApiaceaeGenusAnethumSpesiesAnethum graveolens Linnaeus, 1753 Tata namaSinonim taksonPeucedanum graveolens (L.) C. B. Clarkelbs Adas sowa adalah jenis tumbuhan berbunga dan tumbuhan semusim dari famili Apiaceae.[1] Adas sowa memiliki bunga berwarna kuning serta buah dengan bau yang menyengat, tetapi ban...

 

Pour les articles homonymes, voir Henry Bathurst et Bathurst. Cet article est une ébauche concernant un homme politique britannique. Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants. Henry BathurstFonctionsLord président du Conseil26 janvier 1828 - 22 novembre 1830William BentinckHenry Petty-FitzmauriceSecrétaire d'État aux Affaires étrangères11 octobre - 6 décembre 1809George CanningRichard WellesleyPrési...

العلاقات اليابانية الميانمارية اليابان ميانمار   اليابان   ميانمار تعديل مصدري - تعديل   العلاقات اليابانية الميانمارية هي العلاقات الثنائية التي تجمع بين اليابان وميانمار.[1][2][3][4][5] مقارنة بين البلدين هذه مقارنة عامة ومرجعية للدولتين: و�...

 

1994 novel by Larry Niven First edition, published by Del Rey Books. Cover art by Don Dixon. Crashlander is a fix-up novel by American writer Larry Niven, published in 1994 (ISBN 978-0345381682) and set in his Known Space universe. It is also a term used in the Known Space universe, denoting a human born on the planet We Made It. Plot summary Crashlander brings together the short stories featuring the space pilot Beowulf Shaeffer — Neutron Star (1966), At the Core (1966), Flatlande...

 

Final Liga Champions UEFA 2008Sampul program pertandinganTurnamenLiga Champions UEFA 2007–2008 Manchester United Chelsea 1 1 Setelah perpanjangan waktu Manchester United menang 6–5 pada adu penaltiTanggal21 Mei 2008StadionLuzhniki Stadium, MoscowPemain Terbaik UEFAEdwin van der Sar (Manchester United)[1]Pemain Terbaik Fans'Cristiano Ronaldo (Manchester United)WasitĽuboš Micheľ (Slovakia)Penonton67,310[2]CuacaCloudy14 °C (57 °F)96% kelembaban[3]←...

Untuk kompetisi sepak bola profesional tertinggi di Australia, lihat A-League. Australian Football LeagueOlahragaSepak bola AustraliaDidirikan2 Oktober 1896; 127 tahun lalu (1896-10-02)Musim awal1897CEOGillon McLachlanJumlah tim18NegaraAustraliaMarkas besarMelbourne, Victoria, AustraliaJuara terbanyakCarlton Football ClubEssendon Football Club(16 kali, per 2021)SponsorToyotaKompetisi terkaitAFL Women'sVFLSANFLWAFLNEAFLAFLXSitus web resmiafl.com.au Suasana sebuah pertandingan AFL di Stadi...

 

Alessandro Del Piero Informasi pribadiNama lengkap Alessandro Del PieroTanggal lahir 09 November 1974 (umur 49)Tempat lahir Conegliano, ItaliaTinggi 174 cm (5 ft 8+1⁄2 in)[1]Posisi bermain PenyerangKarier junior1982–1988 San Vendemiano1988–1993 Padova1993–1994 JuventusKarier senior*Tahun Tim Tampil (Gol)1991–1993 Padova 14 (1)1993–2012 Juventus 513 (208)2012–2014 Sydney FC 48 (24)2014 Delhi Dynamos 10 (1)Total 585 (234)Tim nasional1991 Italia U-1...

 

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (ديسمبر 2018) طواف إسبانيا 1979 السلسلة سوبر برستيج بيرنود 1979  التاريخ 24 أبريل – 13 مايو التاريخ بداية:24 أبريل 1979  نه�...

Pantai La Paz La Paz merupakan sebuah kota di Meksiko. Kota ini letaknya di bagian barat. Tepatnya di negara bagian Baja California Sur. Pada tahun 2005, kota ini memiliki jumlah penduduk sebesar 189.176 jiwa. Didirikan pada tahun 1535 dengan nama Santa Cruz dan kemudian mengganti nama menjadi La Paz pada tahun 1596. Pranala luar Situs resmi Diarsipkan 2013-04-08 di Wayback Machine. Marina de La Paz A marina in La Paz B.C.S. VivaLaPaz Diarsipkan 2011-07-01 di Wayback Machine. La Paz official ...

 

تحتاج هذه المقالة إلى الاستشهاد بمصادر إضافية لتحسين وثوقيتها. فضلاً ساهم في تطوير هذه المقالة بإضافة استشهادات من مصادر موثوق بها. من الممكن التشكيك بالمعلومات غير المنسوبة إلى مصدر وإزالتها. (سبتمبر 2018) إيالة الجزائر إيالة الجزائر (العربية) مقاطعة عثمانية (1516–1671)مقاطعة ...

 

Iranian philosopher, theologian and Islamic scholar (born 1933) Seyyed Hossein NasrNasr in 2007BornSeyyed Hossein Nasr (1933-04-07) 7 April 1933 (age 91)Tehran, Imperial State of PersiaAlma materMassachusetts Institute of Technology (BS)Harvard University (MA, PhD)EraContemporary philosophyRegionIslamic philosophySchoolPerennial Philosophy, SufismMain interestsMetaphysics, Philosophy of Religion, Philosophy of Science, Sufism, Islamic philosophyNotable ideas Scientia sacra Ecotheolo...

Degree of individual well-being For other uses, see Quality of life (disambiguation). Quality of life (QOL) is defined by the World Health Organization as an individual's perception of their position in life in the context of the culture and value systems in which they live and in relation to their goals, expectations, standards and concerns.[1] Standard indicators of the quality of life include wealth, employment, the environment, physical and mental health, education, recreation and...

 

Japanese footballer Mitsunari Musaka 六平 光成 Personal informationFull name Mitsunari MusakaDate of birth (1991-01-16) 16 January 1991 (age 33)Place of birth Tokyo, JapanHeight 1.75 m (5 ft 9 in)Position(s) MidfielderTeam informationCurrent team Giravanz KitakyushuNumber 8Youth career2003–2005 FC Tokyo Youth2006–2008 Maebashi ScholarshipHigh School2009–2012 Chuo UniversitySenior career*Years Team Apps (Gls)2013– Shimizu S-Pulse 153 (1)International career2009 ...

 

У Вікіпедії є статті про інші значення цього терміна: Клен (значення). КленПеріод існування: пізній палеоцен — наш час Acer saccharinum Біологічна класифікація Царство: Рослини (Plantae) Клада: Судинні рослини (Tracheophyta) Клада: Покритонасінні (Angiosperms) Клада: Евдикоти (Eudicots) Клада: Рози�...

Civil Service in Bangladesh This article is part of a series on thePolitics of the People's Republic of Bangladesh Constitution Amendments Law of Bangladesh Bangladesh Code Penal Code Human rights Article 70 Judicial review Government President: Mohammed Shahabuddin Prime Minister: Sheikh Hasina Cabinet: Hasina V Taxation Agencies Civil Service Local governments Parliament Speaker: Shirin Sharmin Chaudhury Leader of the House: Sheikh Hasina Leader of the Opposition: GM Quader Judiciary Suprem...

 

Se scappi, ti sposoJulia Roberts in una scena del filmTitolo originaleRunaway Bride Lingua originaleinglese Paese di produzioneStati Uniti d'America Anno1999 Durata116 min Generecommedia, sentimentale RegiaGarry Marshall SoggettoJosann McGibbon, Sara Parriott SceneggiaturaJosann McGibbon, Sara Parriot ProduttoreRobert W. Cort, Ted Field, Tom Rosenberg Distribuzione in italianoUniversal Pictures FotografiaStuart Dryburgh MontaggioBruce Green MusicheJames Newton Howard ScenografiaMark Fried...

 

Бадминтон налетних Олимпийских играх 2024 Одиночный разряд мужчины женщины Парный разряд мужчины женщины микст Квалификация ← 2020 Соревнования по бадминтону на летних Олимпийских играх 2024 пройдут с 27 июля по 5 августа 2024 года. Будут разыграны 5 комплектов наград. В соревн�...

La régulation de la traduction est la phase du contrôle de l'expression des gènes agissant au niveau de la traduction de l'ARN en protéine. Ces mécanismes de régulation affectent principalement l'étape de démarrage de la traduction par le ribosome, assistée par les facteurs d'initiation. Plus rarement, c'est au niveau de la phase d'élongation ou de terminaison de la traduction qu'on peut avoir un contrôle. Dans de nombreux cas, ces mécanismes impliquent des structures spécifiques...

 

2018 African Championships in AthleticsTrack events100 mmenwomen200 mmenwomen400 mmenwomen800 mmenwomen1500 mmenwomen5000 mmenwomen10,000 mmenwomen100 m hurdleswomen110 m hurdlesmen400 m hurdlesmenwomen3000 msteeplechasemenwomen4×100 m relaymenwomen4×400 m relaymenwomenRoad events20 km walkmenwomenField eventsHigh jumpmenwomenPole vaultmenwomenLong jumpmenwomenTriple jumpmenwomenShot putmenwomenDiscus throwmenwomenHammer throwmenwomenJavelin throwmenwomenCombined eventsHeptathlonwomenDecat...