background preloader

DCI

Facebook Twitter

DCI and Services (EJB) Data, Context and Interaction (DCI) is a way to improve the readability of object oriented code. But it has nothing specific to say about things like transactions, security, resources, concurrency, scalability, reliability, or other such concerns. Services, in terms of stateless EJBs or Spring Services, have a lot to say about such concerns, and indeed allow the cross-cutting concerns like transactions and security to be configured outside of the code using annotations or deployment descriptors (XML configuration), letting programmers concentrate on business code. The code they write contains very little code related to transactions or security. The other concerns are handled by the container in which the services live. Services however, constrain developers to think in terms of higher order objects which deliver functionality.

The idea here, is to explore combining a service solution with a DCI solution. Time for an example. 01. 02. 08. 11. 14. 17. return new AsyncResult(energy); 006. 011. User Mental Models - Kitchens in the Zoo. I've spent the last 6 weeks looking into an interesting paradigm called Data, Context & Interaction (DCI). I've written a few introductory papers, and some tools too. DCI has the following goals: 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 the system does) from that for slowly changing domain knowledge (what the system is), instead of combining both in one class interface; To help programmers 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 peoples' mental models, rather than the class style of thinking that overshadowed object thinking early in the history of object-oriented programming languages.

The problem recognised by this paradigm is that system behaviour gets fragmented in traditional OOP, over a large number of classes and sub-classes. Fair enough for a zoo. DCI Plugin for Eclipse - Kitchens in the Zoo. The Data, Context, and Interaction (DCI) architecture paradigm introduces the idea of thinking in terms of roles and contexts.

See some of my white papers for a more detailed introduction into DCI, but for this blog article, consider the following example: a human could be modelled in object oriented programming by creating a super huge massive class which encapsulates all a humans attributes, their behaviours, etc. You would probably end up with something much too complex to be really maintainable. Think about when a human becomes a clown for a kids party; most of that behaviour has little to do with being a programmer, which is a different role which the human could play. So, DCI looks at the problem differently than OOP and solves it by letting the data class be good at being a data class, and putting the behaviours specific to certain roles into "roles", which in my DCI Tools for Java library are classes.

The code ends up looking looking as follows. . © 2010 Ant Kutschera. Notice about Pages and Files. To focus on improving the core functionality of Google Groups -- mailing lists and forum discussions -- we have decided to stop supporting the pages and files features. Even though we know discontinuing these features may inconvenience some of you in the short term, we believe that this move will improve your experience storing and sharing files as other products, such as Google Docs and Google Sites, are designed specifically for file storage and page creation. For example, you can create your pages on Google Sites and share the site with the members of your group. You can also store your files on the site by attaching files to pages on the site. If you’re just looking for a place to upload files so that your group members can download them, we suggest you try using Google Docs.

You can upload files and share access with either a group or an individual, assigning either edit or download only access to the files. The Google Groups Team. DCI Plugin for Eclipse. The Data, Context, and Interaction (DCI) architecture paradigm introduces the idea of thinking in terms of roles and contexts. See some of my white papers for a more detailed introduction into DCI, but for this blog article, consider the following example: a human could be modelled in object oriented programming by creating a super huge massive class which encapsulates all a humans attributes, their behaviours, etc. You would probably end up with something much too complex to be really maintainable. Think about when a human becomes a clown for a kids party; most of that behaviour has little to do with being a programmer, which is a different role which the human could play.

So, DCI looks at the problem differently than OOP and solves it by letting the data class be good at being a data class, and putting the behaviours specific to certain roles into "roles", which in my DCI Tools for Java library are classes. The code ends up looking looking as follows. 01. 07. 08. 09. 16. 02. 26. 30. 01. Data, Context, and Interaction. 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 the system does) from code for slowly changing domain knowledge (what the 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 peoples' mental models, rather than the class style of thinking that overshadowed object thinking early in the history of object-oriented programming languages.

DCI was invented by Trygve Reenskaug, also the inventor of MVC. The current formulation of DCI is mostly the work of Reenskaug and James O. Coplien. Description[edit] Data The data are "what the system is. " An example of a data object could be a bank account. Context Each context represents one or more use cases. Interaction The interaction is "what the system does. " The DCI Architecture: A New Vision of Object-Oriented Programming. The DCI Architecture: A New Vision of Object-Oriented Programmingby Trygve Reenskaug and James O. CoplienMarch 20, 2009 Summary Object-oriented programming was supposed to unify the perspectives of the programmer and the end user in computer code: a boon both to usability and program comprehension.

While objects capture structure well, they fail to capture system action. DCI is a vision to capture the end user cognitive model of roles and interactions between them. Object oriented programming grew out of Doug Englebart's vision of the computer as an extension of the human mind. When a user approaches a GUI, he or she does two things: thinking and doing. We've been good at the mind-meld of structure Both object-oriented design and the Model-View-Controller (MVC) framework grew to support this vision. In some interfaces, this correspondence is obvious: if you create a circle on a PowerPoint® slide, the circle in your mind directly maps onto its representation in computer memory.

Figure 1.