Where used: Mapping Model


hasImage / isImageOf

Mapping hasImage Object Type

Object Type isImageOf Mapping


The image of a mapping is the subset of the range which the mapping
actually returns as output.  For example, the Pet-Of mapping from humans
to animals will have an subtype of animals that are pets at any given
time, namely Pet, which is the image.  Whereas the range gives the
possible results of the mapping, the image gives the actual results.  If
the image is the same as the range, the mapping is said to be onto or
surjective; otherwise it is called into or injective.

Since mappings always return sets, to accommodate multiple-values and
no-values, it is more exact to say that the image is the subset of the
range which has the members in at least one of the sets returned by the
mapping.

There are three ways of modelling images:

    1) Both the range and the image

            In the example above, both the possible and actual pets have
            their own object types, namely Animals and Pets.  This model
            corresponds to the way people normally refer to mappings, as
            in "People have animals as pets", so requirements gathering
            is easier.  It has more overhead than the other two
            techniques, because there are two object types instead of
            one.

    2) Just the range

            If no new features apply to the image, then it is not
            necessary to model it.  For example, if the model says
            nothing new about pets, it can be omitted.  If the pet
            concept is needed on occasion, then the user can test
            whether a particular animal has an owner to see if it is a
            pet.  If the pet concept is needed a lot, then this is not
            the best technique.

            The minimum cardinality on the ObjectType side of the
            hasImage/IsImageOf meta-relation is zero so that it is not
            necessary to model the image.

    3) Just the image

            For example, the Pet-Of mapping may be modelled only between
            Person and Pet.  This technique is best when the context of
            an application assumes pets, because there is no need to
            model the mapping to animals.  If the requirements are being
            gathered in a wider context, however, it is best to model
            that people have animals as pets.

            Notice we aren't really eliminating the range, since it is
            needed to determine the legal outputs of the mapping.  We
            are just restricting the range to be identical to the image,
            or in other words, moving the mapping down from the range to
            the image.