SlideShare una empresa de Scribd logo
1 de 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
....

Más contenido relacionado

Similar a 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
 

Similar a 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
 

Más de 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
 

Más de 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?
 

Último

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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
🐬 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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Último (20)

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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

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