SlideShare ist ein Scribd-Unternehmen logo
1 von 17
DCI
Data Context Interaction:
Re-thinking the foundation of object orientation and of
programming
DCI: Introduction
• Invented by Trygve Reenskaug (MVC)
• Refined by James O. Coplien
• The paradigm separates the domain model (data) from use cases
  (context) and roles that objects play (interaction).
• Complementary to model–view–controller (MVC).

Objectives:
• Improve the of object-oriented code readability
• System behavior gains first-class status;
• To cleanly separate code for rapidly changing system behavior (what the
  system does) from code for slowly changing domain knowledge (what
  the system is)
• Help software developers reason about system-level state and behavior
  instead of only object state and behavior;
• Support an object style of thinking that is close to peoples' mental
  models, rather than the class style of thinking that overshadowed object
  thinking early in the history of object-oriented programming languages.
From procedural to object
orientation
• 1960 – 1970 Procedure Orientation: Succes
1. Data-centric architecture for separation of state and behavior
2. Application design with functional decomposition
3. Textual code flow reflects process flow
4. Peer review of code chunks to get it right the first time
5. Testing as a “no blunder” confirmation

• 1971 – 1995 Class Orientation: Collapse
1. Class-centric architecture with ecapsulated state and
    behavior
2. System design with functional fragmentation
3. Fragmented code NOT show process flow
4. No Chunks: no peer review
5. Code correctness can only be explored by tests
Decomposition vs
  Fragmentation
                     Big Algorithm split
                     in several little chunks




Where is the algo?
All is about objects
•   Class oriented programming
•   OO fails to capture behavior
•   No obvious “place” for interaction to live
•   Failure to capture the user mental model
•   Algorithms: from procedural approach to distributed
    algorithms (coupling and cohesion)
Class oriented programming
•   Nouns are objects and verbs are methods
•   Objects are supposed to be stable
•   Behavior changes frequently
•   Artificial solution: using inheritance to express "programming
    by difference" or "programming by extension”
•   Open-closed principle: the vernacular of the design
•   Liskov Substitution Principle
•   Favor composition over inheritance (16)
•   Domain classes should be dumb!? An anemic domain model
    approach?
Transaction Scripts and Service
 Layer
                          • Poor domain model
• Transaction Scripts     • All the usecase and domain logic into
• No Domain Model           the Transaction Script
                          • Duplicated code


                          • Rich domain model
• Thin/No Service Layer   • Service layer as a facade
• Domain Model            • Uses case centric behavior fails to fit



                          • Rich domain model
• Thick Service Layer     • Thick Service layer
                          • Unable to reuse code in other
• Domain Model              applications
                          • Cross Services code duplication
Users and programmers
mental models
System Operations executed by
Contexts
Roles and DCI
• Combining Structure and
  Algorithm in an Class




• Combining Structure and
  Algorithm in an Object
DCI and User Mental Model
End User and Programmer
reconciliation
MVC
• Information is a key
  element of the end
  user mental model
• Not a set of Observers
• MVC-U is all about
  making connections
  between computer
  data and stuff in the
  end user's head
• Capture well what the
  system is but NOT
  what the system does.
DCI and MVC
• Mapping roles to Objects
• Controller works with
  Contexts
• One context per Use Case

DCI components:
• The data, that live in the
  domain objects that are
  rooted in domain classes;
• The context that brings live
  objects into their positions
  in a scenario, on demand;
• The interactions, that
  describe end-user
  algorithms in terms of the
  roles, both of which can be
  found in end users' heads.
From procedural to object
orientation
• 1960 – 1970 Procedure Orientation: Succes              • 1971 – 1995 Class Orientation: Collapse
1.   Data-centric architecture for separation of state   1.   Class-centric architecture with ecapsulated state
     and behavior                                             and behavior
2.   Application design with functional                  2.   System design with functional fragmentation
     decomposition                                       3.   Fragmented code NOT show process flow
3.   Textual code flow reflects process flow             4.   No Chunks: no peer review
4.   Peer review of code chunks to get it right the      5.   Code correctness can only be explored by tests
     first time
5.   Testing as a “no blunder” confirmation



• 2000 True Object Orientation: A new Beginnig
1. DCI architecture for separation of system stae and behavior
2. Functional separation in Context with Roles
3. Methodful roles show process flow
4. Peer review of code chunks to get it right the first time
5. Testing as a “no blunder” confirmation
Templates Traits Mixins
• C++
  . . . . template <class ConcreteAccountType> class
  TransferMoneySourceAccount {
  public: void transferTo(Currency amount) {
  beginTransaction();
   if (self()->availableBalance() < amount) { . . . . }

  . . . . class SavingsAccount:
  public Account,
  public TransferMoneySourceAccount<SavingsAccount> {
  public: void decreaseBalance(Currency amount) { . . . . }
  }
   ....
Templates Traits Mixins
   • Scala Trait
trait TransferMoneySourceAccount extends SourceAccount {
      this: Account =>
      // This code is reviewable and testable!
      def transferTo(amount: Currency) {
      beginTransaction()
      if (availableBalance < amount) {
            ....
      }
}
....
val source = new SavingsAccount with TransferMoneySourceAccount
val destination = new CheckingAccount with TransferMoneyDestinationAccount
....

Weitere ähnliche Inhalte

Ähnlich wie DCI-Data Context Interaction: A New Paradigm for Object Oriented Programming

Diksha sda presentation
Diksha sda presentationDiksha sda presentation
Diksha sda presentationdikshagupta111
 
Introduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationIntroduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationAndrew Siemer
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyComsysto Reply GmbH
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyComsysto Reply GmbH
 
DCI ANUG - 24th November 2010
DCI ANUG - 24th November 2010DCI ANUG - 24th November 2010
DCI ANUG - 24th November 2010Christian Horsdal
 
DCI - ANUG 24th November 2010
DCI - ANUG 24th November 2010DCI - ANUG 24th November 2010
DCI - ANUG 24th November 2010Christian Horsdal
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design Allan Mangune
 
Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"LogeekNightUkraine
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableComsysto Reply GmbH
 
Different approaches to software design
Different approaches to software designDifferent approaches to software design
Different approaches to software designSandeep Kumar Nayak
 
NoSQL Simplified: Schema vs. Schema-less
NoSQL Simplified: Schema vs. Schema-lessNoSQL Simplified: Schema vs. Schema-less
NoSQL Simplified: Schema vs. Schema-lessInfiniteGraph
 
Software Development: Beyond Training wheels
Software Development: Beyond Training wheelsSoftware Development: Beyond Training wheels
Software Development: Beyond Training wheelsNaveenkumar Muguda
 
Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017Can Pekdemir
 
Review of object orientation
Review of object orientationReview of object orientation
Review of object orientationGurbakash Phonsa
 
Real World Event Sourcing and CQRS
Real World Event Sourcing and CQRSReal World Event Sourcing and CQRS
Real World Event Sourcing and CQRSMatthew Hawkins
 
ORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 SpecificationsORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 SpecificationsAhmed Ramzy
 
Domain driven design and model driven development
Domain driven design and model driven developmentDomain driven design and model driven development
Domain driven design and model driven developmentDmitry Geyzersky
 

Ähnlich wie DCI-Data Context Interaction: A New Paradigm for Object Oriented Programming (20)

Diksha sda presentation
Diksha sda presentationDiksha sda presentation
Diksha sda presentation
 
Introduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationIntroduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregation
 
Software Design
Software DesignSoftware Design
Software Design
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
DCI ANUG - 24th November 2010
DCI ANUG - 24th November 2010DCI ANUG - 24th November 2010
DCI ANUG - 24th November 2010
 
DCI - ANUG 24th November 2010
DCI - ANUG 24th November 2010DCI - ANUG 24th November 2010
DCI - ANUG 24th November 2010
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design
 
Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuable
 
Different approaches to software design
Different approaches to software designDifferent approaches to software design
Different approaches to software design
 
NoSQL Simplified: Schema vs. Schema-less
NoSQL Simplified: Schema vs. Schema-lessNoSQL Simplified: Schema vs. Schema-less
NoSQL Simplified: Schema vs. Schema-less
 
Software Development: Beyond Training wheels
Software Development: Beyond Training wheelsSoftware Development: Beyond Training wheels
Software Development: Beyond Training wheels
 
Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017Domain Driven Design - garajco Education 2017
Domain Driven Design - garajco Education 2017
 
Review of object orientation
Review of object orientationReview of object orientation
Review of object orientation
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 
Real World Event Sourcing and CQRS
Real World Event Sourcing and CQRSReal World Event Sourcing and CQRS
Real World Event Sourcing and CQRS
 
ORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 SpecificationsORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 Specifications
 
Unit 5
Unit 5Unit 5
Unit 5
 
Domain driven design and model driven development
Domain driven design and model driven developmentDomain driven design and model driven development
Domain driven design and model driven development
 

Mehr von cosenzaLab

Manolito Cortese - Guerrilla Marketing
Manolito Cortese - Guerrilla MarketingManolito Cortese - Guerrilla Marketing
Manolito Cortese - Guerrilla MarketingcosenzaLab
 
Stefano Vena - Presentazione secondo appuntamento
Stefano Vena - Presentazione secondo appuntamentoStefano Vena - Presentazione secondo appuntamento
Stefano Vena - Presentazione secondo appuntamentocosenzaLab
 
Ace consulting- Elementi del contratto di rete e il bando nuovi giovani impre...
Ace consulting- Elementi del contratto di rete e il bando nuovi giovani impre...Ace consulting- Elementi del contratto di rete e il bando nuovi giovani impre...
Ace consulting- Elementi del contratto di rete e il bando nuovi giovani impre...cosenzaLab
 
Andrea Infusino - SMM: behind the scene
Andrea Infusino - SMM: behind the sceneAndrea Infusino - SMM: behind the scene
Andrea Infusino - SMM: behind the scenecosenzaLab
 
Il SEO è morto? Scenari attuali e prospettive future.
Il SEO è morto? Scenari attuali e prospettive future.Il SEO è morto? Scenari attuali e prospettive future.
Il SEO è morto? Scenari attuali e prospettive future.cosenzaLab
 
Advertising interattivo e Edutainment – Alessandro Senato
Advertising interattivo e Edutainment – Alessandro SenatoAdvertising interattivo e Edutainment – Alessandro Senato
Advertising interattivo e Edutainment – Alessandro SenatocosenzaLab
 
Realtà aumentata su dispositivi mobili
Realtà aumentata su dispositivi mobiliRealtà aumentata su dispositivi mobili
Realtà aumentata su dispositivi mobilicosenzaLab
 
Home Automation e controllo remoto
Home Automation e controllo remotoHome Automation e controllo remoto
Home Automation e controllo remotocosenzaLab
 
Crowdsourcing, cosa?
Crowdsourcing, cosa?Crowdsourcing, cosa?
Crowdsourcing, cosa?cosenzaLab
 

Mehr von cosenzaLab (9)

Manolito Cortese - Guerrilla Marketing
Manolito Cortese - Guerrilla MarketingManolito Cortese - Guerrilla Marketing
Manolito Cortese - Guerrilla Marketing
 
Stefano Vena - Presentazione secondo appuntamento
Stefano Vena - Presentazione secondo appuntamentoStefano Vena - Presentazione secondo appuntamento
Stefano Vena - Presentazione secondo appuntamento
 
Ace consulting- Elementi del contratto di rete e il bando nuovi giovani impre...
Ace consulting- Elementi del contratto di rete e il bando nuovi giovani impre...Ace consulting- Elementi del contratto di rete e il bando nuovi giovani impre...
Ace consulting- Elementi del contratto di rete e il bando nuovi giovani impre...
 
Andrea Infusino - SMM: behind the scene
Andrea Infusino - SMM: behind the sceneAndrea Infusino - SMM: behind the scene
Andrea Infusino - SMM: behind the scene
 
Il SEO è morto? Scenari attuali e prospettive future.
Il SEO è morto? Scenari attuali e prospettive future.Il SEO è morto? Scenari attuali e prospettive future.
Il SEO è morto? Scenari attuali e prospettive future.
 
Advertising interattivo e Edutainment – Alessandro Senato
Advertising interattivo e Edutainment – Alessandro SenatoAdvertising interattivo e Edutainment – Alessandro Senato
Advertising interattivo e Edutainment – Alessandro Senato
 
Realtà aumentata su dispositivi mobili
Realtà aumentata su dispositivi mobiliRealtà aumentata su dispositivi mobili
Realtà aumentata su dispositivi mobili
 
Home Automation e controllo remoto
Home Automation e controllo remotoHome Automation e controllo remoto
Home Automation e controllo remoto
 
Crowdsourcing, cosa?
Crowdsourcing, cosa?Crowdsourcing, cosa?
Crowdsourcing, cosa?
 

Kürzlich hochgeladen

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 
🐬 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
 
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
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
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
 
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
 
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
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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
 

Kürzlich hochgeladen (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
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...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
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...
 
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
 
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 ...
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

DCI-Data Context Interaction: A New Paradigm for Object Oriented Programming

  • 1. DCI Data Context Interaction: Re-thinking the foundation of object orientation and of programming
  • 2. DCI: Introduction • Invented by Trygve Reenskaug (MVC) • Refined by James O. Coplien • The paradigm separates the domain model (data) from use cases (context) and roles that objects play (interaction). • Complementary to model–view–controller (MVC). Objectives: • Improve the of object-oriented code readability • System behavior gains first-class status; • To cleanly separate code for rapidly changing system behavior (what the system does) from code for slowly changing domain knowledge (what the system is) • Help software developers reason about system-level state and behavior instead of only object state and behavior; • Support an object style of thinking that is close to peoples' mental models, rather than the class style of thinking that overshadowed object thinking early in the history of object-oriented programming languages.
  • 3. From procedural to object orientation • 1960 – 1970 Procedure Orientation: Succes 1. Data-centric architecture for separation of state and behavior 2. Application design with functional decomposition 3. Textual code flow reflects process flow 4. Peer review of code chunks to get it right the first time 5. Testing as a “no blunder” confirmation • 1971 – 1995 Class Orientation: Collapse 1. Class-centric architecture with ecapsulated state and behavior 2. System design with functional fragmentation 3. Fragmented code NOT show process flow 4. No Chunks: no peer review 5. Code correctness can only be explored by tests
  • 4. Decomposition vs Fragmentation Big Algorithm split in several little chunks Where is the algo?
  • 5. All is about objects • Class oriented programming • OO fails to capture behavior • No obvious “place” for interaction to live • Failure to capture the user mental model • Algorithms: from procedural approach to distributed algorithms (coupling and cohesion)
  • 6. Class oriented programming • Nouns are objects and verbs are methods • Objects are supposed to be stable • Behavior changes frequently • Artificial solution: using inheritance to express "programming by difference" or "programming by extension” • Open-closed principle: the vernacular of the design • Liskov Substitution Principle • Favor composition over inheritance (16) • Domain classes should be dumb!? An anemic domain model approach?
  • 7. Transaction Scripts and Service Layer • Poor domain model • Transaction Scripts • All the usecase and domain logic into • No Domain Model the Transaction Script • Duplicated code • Rich domain model • Thin/No Service Layer • Service layer as a facade • Domain Model • Uses case centric behavior fails to fit • Rich domain model • Thick Service Layer • Thick Service layer • Unable to reuse code in other • Domain Model applications • Cross Services code duplication
  • 10. Roles and DCI • Combining Structure and Algorithm in an Class • Combining Structure and Algorithm in an Object
  • 11. DCI and User Mental Model
  • 12. End User and Programmer reconciliation
  • 13. MVC • Information is a key element of the end user mental model • Not a set of Observers • MVC-U is all about making connections between computer data and stuff in the end user's head • Capture well what the system is but NOT what the system does.
  • 14. DCI and MVC • Mapping roles to Objects • Controller works with Contexts • One context per Use Case DCI components: • The data, that live in the domain objects that are rooted in domain classes; • The context that brings live objects into their positions in a scenario, on demand; • The interactions, that describe end-user algorithms in terms of the roles, both of which can be found in end users' heads.
  • 15. From procedural to object orientation • 1960 – 1970 Procedure Orientation: Succes • 1971 – 1995 Class Orientation: Collapse 1. Data-centric architecture for separation of state 1. Class-centric architecture with ecapsulated state and behavior and behavior 2. Application design with functional 2. System design with functional fragmentation decomposition 3. Fragmented code NOT show process flow 3. Textual code flow reflects process flow 4. No Chunks: no peer review 4. Peer review of code chunks to get it right the 5. Code correctness can only be explored by tests first time 5. Testing as a “no blunder” confirmation • 2000 True Object Orientation: A new Beginnig 1. DCI architecture for separation of system stae and behavior 2. Functional separation in Context with Roles 3. Methodful roles show process flow 4. Peer review of code chunks to get it right the first time 5. Testing as a “no blunder” confirmation
  • 16. Templates Traits Mixins • C++ . . . . template <class ConcreteAccountType> class TransferMoneySourceAccount { public: void transferTo(Currency amount) { beginTransaction(); if (self()->availableBalance() < amount) { . . . . } . . . . class SavingsAccount: public Account, public TransferMoneySourceAccount<SavingsAccount> { public: void decreaseBalance(Currency amount) { . . . . } } ....
  • 17. Templates Traits Mixins • Scala Trait trait TransferMoneySourceAccount extends SourceAccount { this: Account => // This code is reviewable and testable! def transferTo(amount: Currency) { beginTransaction() if (availableBalance < amount) { .... } } .... val source = new SavingsAccount with TransferMoneySourceAccount val destination = new CheckingAccount with TransferMoneyDestinationAccount ....