Skip to content

Assigner

Leon Starr edited this page Mar 14, 2022 · 6 revisions

An assigner is a state machine that serves as a single point of control for creating links on competitive associations. [MB]

A detailed description of where Assigners are required, the problem they solve, and how to build them is available in [MB] and [OOA96].

Briefly though, on an Association where the instances on each side are trying to reference each other, a kind of moderator may be required to ensure that multiple instances on one side of the Association don’t all try to reference the same instance on the other side when only one (on one or both sides) may be referenced at a time. The moderation task can’t be delegated to a Lifecycle State Model on either side of the Association due to competition. In the naturally concurrent world of Shlaer-Mellor [LSSYNC], we need to be explicit when platform-independent sequencing is required.

An Assigner solves the problem by creating a single, platform independent, point of control where the competition can be resolved deterministically.

An Assigner is specified as a State Model with a single token (in the case of a Single Assigner) which steps through the process of verifying the existence of available instances or waiting for an instance to become available, choosing the instances to reference when sufficient instances are available using relevant selection criteria, locking down the instances to be referenced to avoid a race condition (using status attributes) and then creating the referencing instance in a concurrent-safe manner.

Whereas [MB] prescribes the use of a class-based state machine for an Assigner to support UML compliance and easy implementation in existing UML tools, The original Shlaer-Mellor seems to suggest that the assigner state machine is bound directly to an Association. The relationship to an Association Class appears incidental.

Associating assigners with (Associations) has two very desirable consequences. First, the analyst is now free to choose how to formalize the competitive (Association) and is no longer forced to do so with an (Association Class). Secondly, all (Classes) have, at most, one possible state model: a lifecycle model. [OOA96]

While a class-based assigner idea works, in practice it is misappropriated to support all manner of class-based activity that is properly formalized with specification Classes and single instance Classes. In fact, the concept of an Assigner is quickly forgotten and C++ style ‘static class’ behavior begins sprouting all over the class model.

The idea of a State Model built directly on an Association to manage competition avoids any confusion about the purpose of such a State Model. To map to standard UML, generate an extra UML singleton class with a statechart then tag that class as an {assigner}.

Clone this wiki locally