SlideShare a Scribd company logo
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

PPTX
Marco Mancuso - Data Context Interaction
PPTX
Design patterns
PPTX
object oriented Programming ppt
PPTX
Architecture Principles CodeStock
PPTX
Hidden Facts of .NET Language Gems
PDF
A tale of two microservices
PDF
Mediator Design Pattern
Marco Mancuso - Data Context Interaction
Design patterns
object oriented Programming ppt
Architecture Principles CodeStock
Hidden Facts of .NET Language Gems
A tale of two microservices
Mediator Design Pattern

What's hot (11)

PDF
Evolutionary architecture: evolving even the language
PPTX
Chapter 7 achieving object-oriented design
PDF
Solid principles, Design Patterns, and Domain Driven Design
PPTX
Low Level Design
PPTX
Object-oriented programming
PPTX
Advanced oop laws, principles, idioms
PPTX
Object relationship model of software engineering,a subtopic of object orient...
DOCX
Design patterns
PPTX
Methodologies in OOAD
ODP
Mediator
PPTX
Evolutionary architecture: evolving even the language
Chapter 7 achieving object-oriented design
Solid principles, Design Patterns, and Domain Driven Design
Low Level Design
Object-oriented programming
Advanced oop laws, principles, idioms
Object relationship model of software engineering,a subtopic of object orient...
Design patterns
Methodologies in OOAD
Mediator
Ad

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

PDF
DCI with Ruby and Rails
PPTX
Design pattern 1
DOCX
Design Pattern Notes: Nagpur University
PPT
Design patterns
PPTX
Introduction to Design Patterns
PDF
Object-oriented modeling and design.pdf
PPTX
Design patterns
PPTX
CAUCE - Model-driven development of ubiquitous computing environments
PPTX
Sofwear deasign and need of design pattern
PPTX
Design patterns
PPT
Design pattern in android
PPT
P Training Presentation
PPTX
INTRODUCTION AND BASIC CONCEPT OF OOAD.pptx
PDF
PPTX
Design patterns
PPTX
Object oriented methodologies
PPTX
Jeet ooad unit-2
DOCX
Patterns (contd)Software Development ProcessDesign patte.docx
PPTX
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
DCI with Ruby and Rails
Design pattern 1
Design Pattern Notes: Nagpur University
Design patterns
Introduction to Design Patterns
Object-oriented modeling and design.pdf
Design patterns
CAUCE - Model-driven development of ubiquitous computing environments
Sofwear deasign and need of design pattern
Design patterns
Design pattern in android
P Training Presentation
INTRODUCTION AND BASIC CONCEPT OF OOAD.pptx
Design patterns
Object oriented methodologies
Jeet ooad unit-2
Patterns (contd)Software Development ProcessDesign patte.docx
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Ad

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
1. Introduction to Computer Programming.pptx
PDF
Hybrid model detection and classification of lung cancer
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Approach and Philosophy of On baking technology
PDF
project resource management chapter-09.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
A Presentation on Touch Screen Technology
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Group 1 Presentation -Planning and Decision Making .pptx
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
1. Introduction to Computer Programming.pptx
Hybrid model detection and classification of lung cancer
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Approach and Philosophy of On baking technology
project resource management chapter-09.pdf
A novel scalable deep ensemble learning framework for big data classification...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
cloud_computing_Infrastucture_as_cloud_p
A Presentation on Touch Screen Technology
Enhancing emotion recognition model for a student engagement use case through...
Hindi spoken digit analysis for native and non-native speakers
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
DP Operators-handbook-extract for the Mautical Institute
MIND Revenue Release Quarter 2 2025 Press Release
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf

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