UML Diagrams Zicomi Systems publishes some UML example diagrams online from the world famous UML dictionary. more...
Version 2.5 Released Zicomi Systems is delighted to announce that version 2.5 of Zicomi Mentor is released. With support for UML 2.0 and all thirteen UML diagrams more...
Zicomi Systems' Director speaks about the UML at Objects by Design - an informative interview more...
Partner Programme Zicom Systems is delighted to announce a new world wide partner programme, become a partner today. more...
OMG Member Zicom Systems is made a member of the OMG!
Element Import
An element import is a directed relationship between a packageable element (arrowhead end) and an importing namespace (tail end). The element that is pointed to is added to the namespace, allowing the element to be used in the namespace without any qualification. A name can be added to the element import relationship, which is used as an alias (alternative name) for the element in the importing namespace. The visibility of the element in the importing namespace is by default public.
Explanation
While working with a package or other namespace a modeler quite commonly needs to refer to an element that is defined in another package or namespace. This may be done by using the fully qualified name of the element, which includes the name of the package. The element import relationship allows the modeler to define a relationship between the element and the package they are working in and then to use the element name as though it were defined in the package they are working in. The relationship is a convenient way of referencing another element but does not allow the element to be changed in the importing package.
Important Points
The visibility of the element import can be the same or more restrictive than the visibility of the element in the referenced package.
An element import relationship may specify a visibility for the imported element. This visibility may not be less restrictive than the visibility that the element has in the referenced package (the package at the arrowhead end of the relationship.)
Related Entries
Package ImportSimilar Usage, Confused with, More Specific
A package import is related to an element import in that it has similar but less restrictive usage. Whereas an element import only adds a single element to the importing package (tail end) a package import adds all the elements in the imported package (arrowhead end) to the importing package.
An element import with keyword import is related to a element import with a keyword access but is stronger. An element import adds the element from the imported package to the importing package; this element can in turn be imported by another package. By using the keyword access the element in the imported package (arrowhead end) is not added to the namespace but can be accessed by an unqualified name from within the importing package.