A. Object Initialization. The views include a
class tree, (in the initialization tab of a Rhapsody
configuration, e.g., figure 2, left bottom), object
initialization code (in lower half of initialization tab,
figure 2) and call stack and instance features
windows (also in figure 2). In addition, a model
level textual output simulation (the Rhapsody Tracer
tool, e.g., as in section 4.2. "OMTracer New
instance A[0]:A created by main").
All of these "Abstractions" may strike the reader
as very close to the implementation code level.
However they are indeed abstractions, albeit just
above the code level. "Initialization" necessarily
begins with object creation via the class' constructor.
However, for a reactive class (whose behavior is
defined by a statechart) it will also include
initialization of the statechart. Objects may be
instantiated one after the other via sequential calls to
constructors in main (as a result of the classes being
checked off in the configuration initialization tab, or
by nested calls to constructors of the different
classes. The "abstraction" in this case would be the
simulated call stack. For sequential calls, the
constructors are popped off the stack sequentially.
For nested calls, the constructors are pushed down,
and then popped off in reverse order.
Due to space limitations, the paper does not
discuss the composition/composite relationships, in
which the life and death cycles of the contained
objects are tied to those of the containing object. For
these relationships, the “abstractions” are less
perfunctory, both in the tracer (textual) and
animation (graphical) representations give
expression to the creational scenario, in which the
contained objects are created as free-standing
instances, (e.g., A[0]) and at the point at which the
containing object is created, the contained are
“renamed” (the term used in the tracer) relative to
the containing object (e.g., C[0]->itsA). This
transformation is experienced in various views:
tracer output, animated sequence diagram, instance
features.
B. Constructional Scenarios. Various scenarios
of construction are driven by main code, as per the
aforementioned configuration specification. Model
level views of scenario execution are expressed in
the tracer, and in animated sequence diagrams as
captured in the various figures starting with figure 2.
C. Inter-object Relations. These have textual
and graphical representations. The tracer output
expresses the formation of relations, e.g., “A[0]
Relation itsB set to B[0]”. Whether a
given object is connected to another object, and if so
to which object is expressed in the relation section of
the instance features window (e.g., Features of A[0]
in figure 4). Where the interaction between objects
during relation connection is complex, a
combination of graphical views (e.g., the animated
sequence diagram of figure 10) and framework code
(figure 9) provides a higher and lower level of
abstraction. Mandatory initializations, such as the
assignment of NULL to an association end whose
relation has yet to be connected, are best expressed
by examining the automatic code generated for
constructors, as in section 4.1.
D. Object State. The state of an object at any
given moment is comprised of the value of its
instance variables shown in the upper half of the
instance features window (, and for reactive objects,
by the its present state as expressed in a color-coded
instance statechart. The examples herein show the
instance variable area of instance features windows,
although none of the examples actually have
instance variables. Instance statecharts are not
addressed at all herein.
As can be seen from the above, the abstractions
and their various representations are somewhat
eclectic. Nonetheless, their overall utility can be
captured heuristically as follows:
(1) Create a UML Class Diagram depicting the
relationship. (2) Define one or more constructional
scenarios via a configuration initialization tab. (3)
Execute the scenario at the model level via the tracer
and animation simulations. (4) Contemplate the
underlying abstractions via the various textual and
graphical views. In the two examples that follow
(directional and bi-directional associations) we
denote the aforementioned abstractions in bold.
4 UML STRUCTURAL
SEMANTICS
As Harel and Rumpe observe, it is commonly, and
incorrectly, believed that precise semantics is
required for behavioral aspects of UML, such as for
statecharts, but not for structural aspects, such as
class diagrams (Harel and Rumpe, 2004) . Whereas
the semantics of class diagrams may seem like
laborious formalism to the in-the-trenches
practitioner, system construction is very much
“alive” and relevant to the practitioner. It is this
aspect of structural model semantics that is
exemplified in the following sub-sections, which
addresses directional associations, and bi-directional
associations, respectively, using multiple model-
level views of software artifacts.
SKY 2016 - 7th International Workshop on Software Knowledge
46