ArticleslgStudy

computer science

Data, context and interaction

Data, context and interaction is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Data, context and interaction rather than just read about it. In short: 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 int…

Key takeaways

  • Data, context and interaction belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Data, context and interaction to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Data, context and interaction from memory before moving on to harder problems.

Reference excerpt

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.

Description

Data The data remains "what the system is." The data part of the DCI architecture is its (relatively) static data model with relations. The data design is usually coded up as conventional classes that represent the basic domain structure of the system. These classes are barely smart data, and they explicitly lack the functionality that is peculiar to support of any particular use case. These classes commonly encapsulate the physical storage of the data. These data implement an information structure that comes from the mental model of end users, domain experts, programmers, and other people in the system. They may correspond closely to the model objects of MVC. An example of a data object could be a bank account. Its interface would have basic operations for increasing and decreasing the balance and for inquiring about the current balance. The interface would likely not offer operations that involve transactions, or which in any way involve other objects or any user interaction. So, for example, while a bank account may offer a primitive for increasing the balance, it would have no method called deposit. Such operations belong instead in the interaction part of DCI. Data objects are instances of classes that might come from domain-driven design, and such classes might use subtyping relationships to organize domain data. Though it reduces to classes in the end, DCI reflects a computational model dominated by object thinking rather than class thinking. Therefore, when thinking "data" in DCI, it means thinking more about the instances at run time than about the classes from which they were instantiated.

Context The context is the class (or its instance) whose code includes the Roles for a given algorithm, scenario, or use case, as well as the code to map these Roles into objects at run time and to enact the use case. Each Role is bound to exactly one object during any given use case enactment; however, a single object may simultaneously play several Roles. A context is instantiated at the beginning of the enactment of an algorithm, scenario, or use case. In summary, a context comprises use cases and algorithms in which data objects are used through specific Roles. Each context represents one or more use cases. A context object is instantiated for each enactment of a use case for which it is responsible. Its main job is to identify the objects that will participate in the use case and to assign them to play the Roles which carry out the use case through their responsibilities. A Role may comprise methods, and each method is some small part of the logic of an algorithm implementing a use case. Role methods run in the context of an object that is selected by the context to play that Role for the current use case enactment. The Role-to-object bindings that take place in a context can be contrasted with the polymorphism of vernacular object-oriented programming. The overall business functionality is the sum of complex, dynamic networks of methods decentralized in multiple contexts and their Roles. Each context is a scope that includes identifiers that correspond to its Roles. Any Role executing within that context can refer to the other Roles in that context through these identifiers. These identifiers have come to be called RoleMethods. At use case enactment time, each and every one of these identifiers becomes bound to an object playing the corresponding Role for this context. An example of a context could be a wire transfer between two accounts, where data models (the banking accounts) are used through Roles named SourceAccount and DestinationAccount.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Data, context and interaction

Start with the simplest possible case. Write down what Data, context and interaction claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Data, context and interaction before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Data, context and interaction ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Data, context and interaction

In research
Data, context and interaction appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Data, context and interaction in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Data, context and interaction is common in secondary-school and first-year university syllabi. It links to neighbouring topics Software architecture, Software design patterns, so understanding it makes those chapters shorter.
In everyday life
Look for Data, context and interaction outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Data, context and interaction” →

How to study Data, context and interaction in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Data, context and interaction means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Data, context and interaction out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Data, context and interaction in simple terms?

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 (wh…

Why does Data, context and interaction matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Data, context and interaction?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Data, context and interaction.

Tags

  • Software architecture
  • Software design patterns

Keep exploring