This shows you the differences between two versions of the page.
what_is_the_relationship_between_classes_objects_roles_and_contexts [2014/10/22 15:02] gazoot [What is the relationship between Classes, Objects, Roles and Contexts?] |
what_is_the_relationship_between_classes_objects_roles_and_contexts [2014/11/09 04:48] (current) gazoot [What is the relationship between Classes, Objects, Roles and Contexts?] |
||
---|---|---|---|
Line 5: | Line 5: | ||
A class serves well as a static data structure, a collection of defining properties and relations defined by system architects and domain experts. When a class is instantiated as an object however, that object will interact with other objects in ways that does not directly associate to its basic definitions. A pen does not know how to write, writing requires interaction between for example a pen, a human and a paper. From a system perspective, neither of these objects are valid places for this interaction between objects called "writing", instead an encompassing system will define how writing should occur, and will access the concerned object properties when needed during the process. | A class serves well as a static data structure, a collection of defining properties and relations defined by system architects and domain experts. When a class is instantiated as an object however, that object will interact with other objects in ways that does not directly associate to its basic definitions. A pen does not know how to write, writing requires interaction between for example a pen, a human and a paper. From a system perspective, neither of these objects are valid places for this interaction between objects called "writing", instead an encompassing system will define how writing should occur, and will access the concerned object properties when needed during the process. | ||
- | Writing is a more generic process, or as DCI calls it, "Context", than one that handles only the specific objects pen, human and paper. That's where Roles comes in. Writing can be done on basically any material, so in a writing Context it makes sense that the object "Paper" should be referred to, or //play the Role// "Material" in the writing context. The same goes for the other objects: | + | You may argue that the human may be a good place for this functionality. Writing however is a more generic process, or as DCI calls it, "Context", than one that handles only the specific objects pen, human and paper. That's where Roles comes in. Writing can be done on basically any material, so in a "Writing" Context it makes sense that the object "Paper" should be referred to, or //play the Role// "Material" in the writing context. The same goes for the other objects: |
* The object //Pen// plays the Role //Instrument// in the //Writing// Context. | * The object //Pen// plays the Role //Instrument// in the //Writing// Context. | ||
Line 15: | Line 15: | ||
Note that the system-specific naming and terms above should be created in accordance with system architects and domain experts, to follow domain terminology and a given mental model as closely as possible. | Note that the system-specific naming and terms above should be created in accordance with system architects and domain experts, to follow domain terminology and a given mental model as closely as possible. | ||
- | ==== Summary ==== | + | ===== Summary ===== |
- | * A Class is a basic data structure for an object | + | * A Class is a basic data structure for an Object |
* An Object can play a Role in a Context | * An Object can play a Role in a Context | ||
* A Context specifies a network of communicating Objects as interconnected Roles | * A Context specifies a network of communicating Objects as interconnected Roles |