Questions tagged [dci]

Data, Context, Interactions (DCI) DCI was invented by Professor Trygve Reenskaug to solve a specific problem in OO code; it's very hard to read OO code for a specific use-case since it is often spread across many different classes, and the control flow between the methods of these classes depend on which objects are instantiated to which variables. With DCI Reenskaug proposed a new way of coding for use-cases where each use-case is implemented as a

Data, Context, Interactions (DCI)

DCI was invented by Professor Trygve Reenskaug to solve a specific problem in OO code; it's very hard to read OO code for a specific use-case since it is often spread across many different classes, and the control flow between the methods of these classes depend on which objects are instantiated to which variables.

With DCI Reenskaug proposed a new way of coding for use-cases where each use-case is implemented as a Context and each participating object has a Role in that Context.

Methods can be written for the Context and for the Roles. The Role-Methods are considered instance methods of the object playing the associated Role. A RoleMethod exists only in the scope of a context. When an object no longer plays a role, the RoleMethods are no longer part of the object

This approach allows the code for a given use-case to be organized in the Context construct and can easily be read and understood as a complete artifact.

DCI is not a pattern that can be easily implemented in any OO language, it is more of a suggestion for the next evolution of the OO universe. For most languages new keywords would have to be added. Reenskaug has however done an implementation of DCI in SmallTalk and a language call Marvin has been design and implemented with the support of DCI in mind.

To learn more look at the community site for DCI called fullOO

31 questions
645
votes
7 answers

How to use concerns in Rails 4

The default Rails 4 project generator now creates the directory "concerns" under controllers and models. I have found some explanations about how to use routing concerns, but nothing about controllers or models. I am pretty sure it has to do with…
yagooar
  • 15,959
  • 6
  • 20
  • 21
342
votes
7 answers

Where to put model data and behaviour? [tl; dr; Use Services]

I am working with AngularJS for my latest project. In the documentation and tutorials all model data is put into the controller scope. I understand that is has to be there to be available for the controller and thus within the corresponding…
Nils Blum-Oeste
  • 5,608
  • 4
  • 25
  • 26
39
votes
5 answers

DCI - Data, Context and Interaction - Successor to MVC?

What is the best description of Data, Context and Interaction (DCI) to pitch it to an organization? It's created by Trygve Reenskaug, the creator of the MVC-pattern. Is it really the successor to MVC or just another pattern? And what are its pros…
Seb Nilsson
  • 26,200
  • 30
  • 103
  • 130
24
votes
4 answers

What is DCI and how can it fit with Rails?

A recent debate with a co-worker about different approaches to design and code the models in a Rails application brought me across DCI in the context of Rails. However, I just can't seem to wrap my head around that entire concept, even after going…
GeReV
  • 3,195
  • 7
  • 32
  • 44
22
votes
6 answers

examples of DCI architecture?

I've been trying to understand DCI architecture by reading lean software architecture. I feel like I need to see some more examples to crystalize my understanding of it, but I've only been able to find ones which are variations of the money transfer…
Jonny Cundall
  • 2,552
  • 1
  • 21
  • 33
12
votes
1 answer

RESTful DCI contexts in Rails

I first learned about Data, context, and interaction (DCI) through this blog post. Fascinated by the concept, I endeavored to build it in to my next Rails application. Since DCI works in tandem with MVC, I thought it wouldn't be too hard to make the…
Reed G. Law
  • 3,897
  • 1
  • 41
  • 78
9
votes
3 answers

How to understand DCI pattern

According to Wikipedia Data, context and interaction (DCI) is a paradigm used in computer software to program systems of communicating objects. Here I am not clear about the problem which DCI tries to solve. Can you explain it with simple example?…
Malintha
  • 4,512
  • 9
  • 48
  • 82
8
votes
1 answer

Where to put validations when following a DCI design?

I'm following DCI to structure the behavior of a new Rails application, but I have some doubts about where to put the validations. Traditionally, if you're going to manage your data using ActiveRecord models, validations are defined at the…
Carlos Paramio
  • 531
  • 1
  • 4
  • 6
7
votes
2 answers

How to combine DDD(Domain-driven design) DCI to design a application

DDD is Domain-Driven Design , it is a methodology that include ubiquitous language, root entity , value object and aggregations.. DCI: Data, Context, Interactions is a programming paradigm invented by Trygve Reenskaug. how can I combine with them in…
banq
  • 75
  • 5
5
votes
3 answers

Can Scala constrain an object graph so that only those objects relevant to the context are visible?

Is there a way to use Scala's type-system to concisely specify the context-relevant subgraph of a complete object graph? DCI argues that you often have a fairly complex object graph but in any one use-case you often only want to work with a…
Larry OBrien
  • 8,484
  • 1
  • 41
  • 75
5
votes
3 answers

DCI (data, context, interaction) persistence example

All the examples of DCI I've seen seems to be based on the object as the ultimate holder of information, and the transaction boundaries are defined inside the methods. I would like to see an example of a persistent application, where there is some…
nilskp
  • 3,097
  • 1
  • 30
  • 34
5
votes
0 answers

DCI example at Java

I am looking for some examples at Java in order to better understand what is DCI and how it should be used. I have found some great DCI example at C++ here http://fulloo.info/Examples/C++Examples/Account1/ If you are not familiar with DCI…
alexsmail
  • 5,661
  • 7
  • 37
  • 57
4
votes
2 answers

What are possible designs for the DCI architecture?

What are possibles designs for implementation of the DCI (data, contexts, interactions) architecture in different OOP languages? I thought of Policy based design (Andrei Alexandrescu) for C++, DI and AOP for Java. However, I also thought about using…
Gabriel Ščerbák
  • 18,240
  • 8
  • 37
  • 52
4
votes
1 answer

Data-Context-Interaction (DCI) and evented programming in javascript

I recently saw the following presentation on DCI by Trygve Reenskaug : https://vimeo.com/43536416 It kinda blew my mind. Mmmh, seeing in code the interaction between different components of a software is an attractive idea. I tried to find…
3
votes
1 answer

How to test the behaviour with DCI pattern?

I'm writing a simple webgame to experiment the DCI pattern and I was wondering how to test the context properly. https://gist.github.com/1718889 I have a context CharacterAttacksAnotherCharacter which take two characters and extend them with two…
Romain Tribes
  • 1,818
  • 2
  • 17
  • 21
1
2 3