Last updated at 3:00 am UTC on 7 April 2017
Thu, May 22, 2014 at 10:27 AM
Reply-To: The general-purpose Squeak developers list
To: The general-purpose Squeak developers list
For introduction to DCI, see this Wikipedia article
Data, Context, and Interaction, an architectural pattern in computer software development
Data, context and interaction (DCI) is a paradigm used in computer software to program systems of communicating objects. Its goals are:
- To improve the readability of object-oriented code by giving system behavior first-class status;
- To cleanly separate code for rapidly changing system behavior (what a system does) versus slowly changing domain knowledge (what a system is), instead of combining both in one class interface;
- To help software developers reason about system-level state and behavior instead of only object state and behavior;
- To support an object style of thinking that is close to programmers' mental models, rather than the class style of thinking that overshadowed object thinking early in the history of object-oriented programming languages.
The paradigm separates the domain model (data) from use cases (context) and Roles that objects play (interaction).
DCI is complementary to model–view–controller (MVC). MVC as a pattern language is still used to separate the data and its processing from presentation.
Object interaction (DCI)_
The essence of object orientation is that networks of collaborating objects work together to achieve a common goal. The common sense of object oriented programming should reflect this essence with code that specifies how the objects collaborate. Our industry has, unfortunately, chosen differently and code is commonly written in terms of classes. A class tells us everything about the properties of the individual objects that are its instances. It does not tell us anything about how these instances work together to achieve the system behavior.
The result is that our code does not reveal everything about how a system will work. This is clearly not satisfactory, and we need a new paradigm as the foundation for more expressive code. The DCI (Data-Context-Interaction) is such a paradigm. DCI separates a program into different perspectives where each perspective focuses on certain system properties. Code in the Data perspective specifies how information is represented by stand-alone objects. Code in the Context perspective specifies runtime networks of interconnected objects as similar structures of interconnected roles. Code in the Interaction perspective specifies how the networked objects collaborate to achieve the system behavior.
Downloads contains a Squeak image for illustration.
See also BabySRE
The complete DCI architecture:
- 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.