Data, context and interaction

DataContext Interaction (DCI ) is an architectural pattern for modeling the professionalism of complex object- oriented software. DCI compartment separates objects ( "Data" ) of use cases ( "Context" ) and roles ( "Interaction" ). DCI was first described by Trygve Reenskaug, the inventor of the Model -View-Controller architecture pattern. He was later supported in the lead by James O. Coplien.

Description

DataContext Interaction is based on the idea, not - as is common elsewhere in the object-oriented analysis and design - to model classes, but to describe objects. When DCI should be more to the instances at run time, thought of modeling as to the classes from which the objects were instantiated.

This approach does not promise to get overloaded with functionality classes, but simple domain objects ( "Data" ) without their own technical functionality that fulfill different roles (ie functionalities), but which are outsourced even in the Interaction classes. The actual professionalism (ie applications ) itself is displayed in the so-called context classes.

DataContext Interaction is characterized by a strict separation of data ( data objects - roughly equivalent to the specialized objects), Context ( Context - corresponding use cases, scenarios or algorithms) and interaction ( interactions - corresponding to the roles that perform the data objects in different contexts ):

Data ( data objects )

Identifies the domain objects and their relations with each other. These data objects contain no more technical features and are more or less simple data holder. They should correspond to the conceptual model of the user to the data of the application. They correspond to the model of the Model -View-Controller architecture pattern.

An example of a data object would be a " bank account". It would have been simple methods to query and change the account balance but no functions that require transactions or access to other objects or user interactions. Such tasks are made possible by the contexts in DCI.

Data classes correspond to the Entities, Value Objects and Aggregates in Domain Driven Design.

Context ( context)

Describe the context in which the data objects used in specific roles. These are the use cases, scenarios and algorithms of the technical task of the application.

Contexts are objects that represent one or more use cases and are instantiated for each execution of a use case. Their main task is to identify the data objects which play a specific role in the application, and to associate with this role. This binding the data objects to their roles is similar to the polymorphism in object-oriented programming.

The implementation of a specific use case is thus the process of a business functionality based on data classes that play a certain role in this application.

The overall business functionality of an application is the sum of a network of methods, decentralized in different roles.

An example of a context would be a bank transfer between two accounts. This bank transfer uses the data object " bank account " in the roles of " source account " and " destination account ". The separation of data objects and roles enables for example, bank transfers between other types of accounts (such as credit accounts or savings accounts ) to implement without behind to take on the actual data objects into consideration.

Interaction ( interactions )

Among interactions are understood at DataContext Interaction roles which data objects can be assigned. A role corresponds with DCI the idea of a user of the responsibilities of objects in the system. A role is a collection of responsibilities.

While in the object-oriented responsibilities are seen in objects or classes, these are the interactions and thus attributed to the roles in DCI. Objects take on a use case specific roles, which may vary from application to application. A bank account once assumes the role of " source account ", other times the role of " target account " and again another time the role of " transfer account".

An example of a role would be a target account to which amounts may be booked at the use case " Bank Transfer".

Comparisons to other technologies

Implementations

Meanwhile, there are a number of early implementations of DataContext Interaction for different programming languages. However, since DCI is another new programming paradigm, its implementation to other programming languages ​​is often bumpy and awkward. For example, the methods of Injecten is usually necessary for the implementation of rollers. A few languages ​​support roles natively in languages ​​other dynamic or static injection or pre- compilation is used to simulate the DCI. A native implementation of DataContext Interaction there is not yet.

The only currently serious implementation of DCI is Qi4j, a Java framework for domain centric application development, based on concepts such as aspect -oriented programming, Data Context Interaction and Domain Driven Design. Scala has the traits known as a language construct with which roles can be implemented natively, in addition, the first steps are for reactions with PHP ( Wax Framework), Smalltalk, C , C #, Ruby, JavaScript, and Python.

219602
de