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

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Recently uploaded (20)

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

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