SlideShare uma empresa 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
....

Mais conteúdo relacionado

Semelhante 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
 

Semelhante 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
 

Mais 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
 

Mais 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

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Último (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

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