SlideShare a Scribd company logo
1 of 13
Download to read offline
Data Context Interaction
     What is it good for?


       Markus Nordin
        @mnordin
Disclaimer
I will for the next 30 minutes talk
         smack about MVC

      But i secretly <3 MVC
History of DCI


Trygve Reenskaugs ideas about role based modeling in early
 2000 (same guy who invented MVC in the late seventies)

              Working design model in 2006

             Working prototype in mid 2008

                  Complement to MVC
Why DCI?

          MVC fails to capture behaviour

 There's no apparent place to put interactions
 (exception: simple actions that involves a single object)

          Model should represent things
            Things should be stable

Natural difference between what an object is and
      what it does. Why not in the code?
Goals with DCI

   Giving system behaviour first class status

  Cleanly separate code for rapidly changing
behavior from code for slowly changing domain
                 knowledge

Object style of thinking that is close to peoples
    mental models rather than class style
Data

                What the system is

         Closely corresponds to the Model

Reflects the domain structure rather than behaviour
Context
 Context is a class (instance) which enacts one (or
                   more) use cases

      Instantiated by a user (controller) action

      Mixes in participating objects with Roles

The context is responsible for acting out the use case
Interaction

             What the system does

           Methods in role modules

Implemented by mixing in objects with Roles in a
          given Context or use case
Executing DCI

Controller action starts a use case by instansiating a context
                             class


     The context finds (or creates) the objects that are
               participating in the use case

 The context mixes in all the roles needed into the objects


 The context invokes the role methods on the objects and
              starts the use case enactment
Money transfer example
Bank - send money to another account



             SendMoneyContext



   account                      account


SourceAccount             DestinationAccount
 send(amount)                verify(amount)
                            deposit(amount)
My implementation
                Training app
           Attend a training event


           UserAttendsEventContext



    user                             event


AttendingRole                  PublicEventRole
attends(event)              attend_on_google(user)
What is it good for?
Kind of awkward to deal with context instances - bad
                implementation?
    Class methods belonging to roles or object?

 Simple console usage must also follow the context


 Easy to find specific methods (if used consistently)
            Fat models go on crash diet!
                  Easy to maintain

          Easy to follow an entire use case
Questions?

Do we need DCI?

More Related Content

What's hot

Evolutionary architecture: evolving even the language
Evolutionary architecture: evolving even the languageEvolutionary architecture: evolving even the language
Evolutionary architecture: evolving even the languageLuram Archanjo
 
Solid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignSolid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignIrwansyah Irwansyah
 
Object-oriented programming
Object-oriented programmingObject-oriented programming
Object-oriented programmingJieyi Wu
 
Advanced oop laws, principles, idioms
Advanced oop laws, principles, idiomsAdvanced oop laws, principles, idioms
Advanced oop laws, principles, idiomsClint Edmonson
 
Object relationship model of software engineering,a subtopic of object orient...
Object relationship model of software engineering,a subtopic of object orient...Object relationship model of software engineering,a subtopic of object orient...
Object relationship model of software engineering,a subtopic of object orient...julia121214
 

What's hot (11)

Evolutionary architecture: evolving even the language
Evolutionary architecture: evolving even the languageEvolutionary architecture: evolving even the language
Evolutionary architecture: evolving even the language
 
Chapter 7 achieving object-oriented design
Chapter 7 achieving object-oriented designChapter 7 achieving object-oriented design
Chapter 7 achieving object-oriented design
 
Solid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignSolid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven Design
 
Low Level Design
Low Level DesignLow Level Design
Low Level Design
 
Object-oriented programming
Object-oriented programmingObject-oriented programming
Object-oriented programming
 
Advanced oop laws, principles, idioms
Advanced oop laws, principles, idiomsAdvanced oop laws, principles, idioms
Advanced oop laws, principles, idioms
 
Object relationship model of software engineering,a subtopic of object orient...
Object relationship model of software engineering,a subtopic of object orient...Object relationship model of software engineering,a subtopic of object orient...
Object relationship model of software engineering,a subtopic of object orient...
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Methodologies in OOAD
Methodologies in OOADMethodologies in OOAD
Methodologies in OOAD
 
Mediator
MediatorMediator
Mediator
 
Sda 8
Sda   8Sda   8
Sda 8
 

Similar to Data Context Interaction - What is it good for?

Design pattern 1
Design pattern 1Design pattern 1
Design pattern 1Naga Muruga
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityShubham Narkhede
 
Object-oriented modeling and design.pdf
Object-oriented modeling and  design.pdfObject-oriented modeling and  design.pdf
Object-oriented modeling and design.pdfSHIVAM691605
 
CAUCE - Model-driven development of ubiquitous computing environments
CAUCE - Model-driven development of ubiquitous computing environmentsCAUCE - Model-driven development of ubiquitous computing environments
CAUCE - Model-driven development of ubiquitous computing environmentsRicardo Tesoriero
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design patternchetankane
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in androidJay Kumarr
 
P Training Presentation
P Training PresentationP Training Presentation
P Training PresentationGaurav Tyagi
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologiesnaina-rani
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxdanhaley45372
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Luis Valencia
 
Itp oo mand-d
Itp oo mand-dItp oo mand-d
Itp oo mand-dShibu S R
 

Similar to Data Context Interaction - What is it good for? (20)

DCI with Ruby and Rails
DCI with Ruby and RailsDCI with Ruby and Rails
DCI with Ruby and Rails
 
Design pattern 1
Design pattern 1Design pattern 1
Design pattern 1
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur University
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Introduction to Design Patterns
Introduction to Design PatternsIntroduction to Design Patterns
Introduction to Design Patterns
 
Object-oriented modeling and design.pdf
Object-oriented modeling and  design.pdfObject-oriented modeling and  design.pdf
Object-oriented modeling and design.pdf
 
Design patterns
Design patternsDesign patterns
Design patterns
 
CAUCE - Model-driven development of ubiquitous computing environments
CAUCE - Model-driven development of ubiquitous computing environmentsCAUCE - Model-driven development of ubiquitous computing environments
CAUCE - Model-driven development of ubiquitous computing environments
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design pattern
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in android
 
P Training Presentation
P Training PresentationP Training Presentation
P Training Presentation
 
Ooad 2
Ooad 2Ooad 2
Ooad 2
 
Ooad
OoadOoad
Ooad
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
 
Jeet ooad unit-2
Jeet ooad unit-2Jeet ooad unit-2
Jeet ooad unit-2
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docx
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
 
Itp oo mand-d
Itp oo mand-dItp oo mand-d
Itp oo mand-d
 

Recently uploaded

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Data Context Interaction - What is it good for?

  • 1. Data Context Interaction What is it good for? Markus Nordin @mnordin
  • 2. Disclaimer I will for the next 30 minutes talk smack about MVC But i secretly <3 MVC
  • 3. History of DCI Trygve Reenskaugs ideas about role based modeling in early 2000 (same guy who invented MVC in the late seventies) Working design model in 2006 Working prototype in mid 2008 Complement to MVC
  • 4. Why DCI? MVC fails to capture behaviour There's no apparent place to put interactions (exception: simple actions that involves a single object) Model should represent things Things should be stable Natural difference between what an object is and what it does. Why not in the code?
  • 5. Goals with DCI Giving system behaviour first class status Cleanly separate code for rapidly changing behavior from code for slowly changing domain knowledge Object style of thinking that is close to peoples mental models rather than class style
  • 6. Data What the system is Closely corresponds to the Model Reflects the domain structure rather than behaviour
  • 7. Context Context is a class (instance) which enacts one (or more) use cases Instantiated by a user (controller) action Mixes in participating objects with Roles The context is responsible for acting out the use case
  • 8. Interaction What the system does Methods in role modules Implemented by mixing in objects with Roles in a given Context or use case
  • 9. Executing DCI Controller action starts a use case by instansiating a context class The context finds (or creates) the objects that are participating in the use case The context mixes in all the roles needed into the objects The context invokes the role methods on the objects and starts the use case enactment
  • 10. Money transfer example Bank - send money to another account SendMoneyContext account account SourceAccount DestinationAccount send(amount) verify(amount) deposit(amount)
  • 11. My implementation Training app Attend a training event UserAttendsEventContext user event AttendingRole PublicEventRole attends(event) attend_on_google(user)
  • 12. What is it good for? Kind of awkward to deal with context instances - bad implementation? Class methods belonging to roles or object? Simple console usage must also follow the context Easy to find specific methods (if used consistently) Fat models go on crash diet! Easy to maintain Easy to follow an entire use case