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 Marco Mancuso - Data Context Interaction

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 Marco Mancuso - Data Context Interaction (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

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 

Kürzlich hochgeladen (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Marco Mancuso - Data Context Interaction

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