2. Agenda
• Intro to the DCI paradigm
• Real OO
• Real separation of concerns
• Readable business logic
• Testable
• Break
• Demo
3. Who Am I?
• Comp. Sci. master from University of Aarhus 2001
• Developer and Architect at Mjølner Informatics
• Blog: horsdal.blogspot.com
4. 4
Domain models at a glance
Wikipedia:
a conceptual model of a
system which describes the
various entities involved in
that system and their
relationships
“Basic domain concepts change
slowly; it’s the features and
technology that change
rapidly”
-James O. Coplien
“a conceptual model of a system
which describes the various
entities involved in that system
and their relationships”
-Wikipedia
6. 6
MVC at a glance
Problem
Develop UI that:
• Supports change w/o affecting core
functionality
• Displays current state and responds to
state changes immediately
Solution
Divide into three loosely coupled parts:
• Model objects encapsulate a core entities
• Views present data and information to the
user.
• Controllers are associated with views and
allow manipulation of the presented data
and information.
11
19. 19
DCI: Interaction
• Involves several domain objects selected dynamically
• …based on context
• Implemented in the roles
SavingAccount as MoneySource CheckinngAccount as MoneySink TransactionManager
20. 20
DCI: Context
• Encapsulates runtime object graph
• Assign roles to objects
• not to classes
MoneyTransferContex
MoneySource MoneySink TransactionManager
21. 21
DCI: Data
• Concrete domain objects
• Dumb or barely smart
SavingAccount
Balance
Account number
Owner
CheckingAccount
Balance
Account number
Owner
28. Background - DCI
• Invented by Trygve Reenskaug
• Who also invented MVC
• James O. Coplien recently published a book about DCI, agile
and lean
• Nice implementation in Scala, Ruby and Smalltalk
• Acceptable implementations in Python, C++, C# and others
29. Acknowlegdements
• Direct manipulation metaphor and DCI overview drawings:
Trygve Reenskaug in the common sense article
• Is vs. Does, MVC+DCI figure and quotes: James O. Copliens
book