Content deleted Content added
m →History: Cosmetic edit |
|||
Line 19:
:
:A Context is an object (or potentially a class) that is a collection of code that 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. A Context is often implemented as a Context class that is instantiated at the beginning of the enactment of an algorithm, scenario, or use case. In summary, a Context is [[use case]]s and [[algorithm]]s in which data models 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 associate them with the roles whose responsibilities characterize the use case. Each role comprises methods, and each method is some small part of the logic of an algorithm implementing a use case. 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 networks of methods decentralized in multiple roles. For a given use case enactment, each of these roles runs in the context of an object selected for it by the Context.
|