|
|
Terminology
- Corresponding
Elements
- are same in
both nets
- or the one in the new net
is a replacement
of the original
in the old net
- One object in the new
net can replace several elements in the old net.
Then it corresponds to several old elements. That's OK as far as
composite invariants are honoured and the new element is of the same
class as the original, or its child class.
- Same
(unchanged) Elements
- are corresponding
- have same
primitive
attributes and
- their references refer to
targets which
are corresponding
to targets in the other net
- queries
on them may return different results
based on objects they
(directly or indirectly) refer to
- are shallowly
equal
- Primitive
- a field which is only for non-Element basic immutable objects like java.lang.Integer
and java.lang.String.
It can't be mirrored, and it has same value in any Context.
- Reference
- Element's field which links to another Element object (internally
stored in ElementPure as references to ElementShadowed)
- Element
- publicly-accessible handle
to reusable object in given Context
- wrapper of Context and
ElementShadowed
- it gets created by associating
ElementShadowed with a
Context
- ElementPure
- internal representation of
reusable object without any history of applied mirrors
- without its mirrors
history and without Context
- a
shadowed of an Element
- ElementShadowed which is
wrapped by given Element
- a
pure of an ElementShadowed or Element
- ElementPure which is
wrapped by given ElementShadowed, or by
shadowed of given Element
- Mirror
- translation pair [old,
newer], which applies in given
Context
- When reusing parts of old
graph(s), there remain references to
other nodes which are not present in new graph(s), but are replaced by new
nodes. These obsolete
references are translated by mirrors
to their new
counterparts.
- mirrors apply to
transitively referenced elements - i.e. they
apply to the whole graph while within given Context
- mirrors can apply possibly
several times in cascade
- ElementPure's
mirror, or mirror of an ElementPure
- mirror which applies to
that ElementPure, and it translates it
to another ElementPure
- applied
mirror's original, mirrored
original, shadow's original
- original ElementShadowed,
which a given applied mirror (Shadows
object) translates to target ElementShadowed
- mirror's
original
- original ElementPure which
gets translated by that mirror
- mirror's
target
- ElementPure to which
original component is translated
within given Context
- graph's
root
- Element (or
ElementShadowed/ElementPure) which is a part of the
graph (or subgraph). It
serves as an entry or top node of the graph in given situation. It's
also used as a base of the graph's mutations.
- A graph can have many roots - TODO
- backward reference
- An ElementContainer may hold a mirror to itself. The
container is a target, and original is an element of same type
(reflection seed). That provides all its components (even deep ones)
with a backward reference to that container. If a container of
same type is between its components, and it provides backward reference
to itself, then the outer backward reference is lost. If both backward
references are to be used within the deeper container, then they
can use different reflection seeds.
- reflection seed
- Object which is mirrored in ElementContainer to the
Container itself. Reflection seed is of the same type as
ElementContainer which is being mirrored to. Reflection seed may be a
seed object, or its mutation. It's usually stored as static final field, so that any
components can access it.
- self reflection
- Use of backward references by methods of
container's components and by methods of container itself. They
use reflection seeds, which get mirrored to
appropriate container in given Context. Backward references
resemble a little bit to ThreadLocal
variables (thread-specific version of once features in Eiffel).
- Context
- list of Element objects on
which the method calls were invoked
- in same order as they
are on method call stack
- except for direct or
indirect recursive invocations of same object
- stack of Element this
objects in
Java/C++/PHP, current
in
Eiffel, self
in Ruby
- Their mirrors are
applicable to all references evaluated within
that Context. It keeps list of all translations currently in effect.
- evaluation of a reference
within a Context reconstitutes object
graphs by applying all mirrors of the Context
- context
precedence - mirrors of upper
(more global) Context supersede
mirrors of any lower (more local) Context
- Applied
mirrors
- cascade of
mirrors that
resulted in Element which is original of the mutation.
- Shadows
- a list of obsolete
reference(s) that get mirrored in cascade resulting in given
reference
- effectively same as
applied mirrors
- represented by linked list
- a silhouette, trace of
past identities
- a stack of mirrors applied
to given ElementPure
- It servers as backward
resolution history. Used to unwind
applied mirror(s)
when
an Element is being returned out of given Context. That is required
in
order to keep old structural relations (defined in old parts of the
graph) valid in a new graph. This way both old and new graphs are
consistent within their Contexts.
- ElementShadowed
- internal representation of
reusable object with history of applied mirrors
- wrapper of ElementPure
and its Shadows
- ElementContainer
- Subclass of Element, which
can hold both primitive
fields and references.
- It can hold
mirrors of Elements. These mirrors get
applied anywhere within its Context.
- ElementRecord
- It can hold primitive
fields only. It doesn't contain any Elements (precisely,
ElementShadowed) and it can't store any
mirrors.
- ElementWrapper
- It can hold only one
primitive field. Its purpose is to wrap
that value and give it an Element identity, so that it can be mirrored
and used as Element.
- ElementPureContainer,
ElementPureRecord, ElementPureWrapper
- different versions
(subclasses) of ElementPure, used with
respective subclass of Element
- Mutation,
mutated object
- an object which collects
any modifications
- represented by an
instance of ElementMutant subclass
- both fields and mirrors
can be set or modified
- a new immutable Element
which is a result of these modifications
- it keeps a reference to
original ElementShadowed
- new values override ones
of the original Element
- Transitive-closure
behaviour of mirrors assures that Elements
down the Context can't access originals of mirrored Elements.
- mutation
of a graph
- a mutation of any of the
graph's roots
- Mutation
Context
- Context where an
original Element (precisely, ElementContainer) was
mutated
- Area
- a group of ElementPures
- an Area should contain
components which are likely to be mirrored in same ElementContainers
(and possibly in same ElementPure mutation generations), if it can be
predicted
- unique seeds, reserved
for use as components of a composite
seed, are likely to be mirrored in composite's mutation, and therefore
they should generally be in same Area
- hash-like disjunctive
distribution of ElementPures
- makes applying cascade
mirrors faster
|