Abstract Class UML 2.4.1::Namespace
Description:
A namespace is an element in a model that contains a set of named elements
that can be identified by name.
Direct Superclasses: NamedElementDirect Subclasses: Transition,
StructuredActivityNode,
State,
Region,
Package,
InteractionOperand,
Classifier,
BehavioralFeatureClass Precedence List: Namespace,
NamedElement,
ElementProperties:
![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
elementImport :
ElementImport (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
importedMember :
PackageableElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
member :
NamedElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
ownedMember :
NamedElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
ownedRule :
Constraint (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
packageImport :
PackageImport (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
clientDependency :
Dependency (0 *); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
name : String (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
nameExpression :
StringExpression (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
namespace :
Namespace (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
qualifiedName : String (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
visibility :
VisibilityKind (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
ownedComment :
Comment (0 *); -- source
Element![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
ownedElement :
Element (0 *); -- source
Element![](/se-interop/image/down-arrow.png?hunchentoot-session=20396%3A2E33414CBC7BA53B6711B52650BD9197)
owner :
Element (0 1); -- source
ElementConstraints:
Signature: members_distinguishable() : Boolean;
Description: All the members of a Namespace are distinguishable within it.
Expression: membersAreDistinguishable()
Operations:
Signature: membersAreDistinguishable() : Boolean;
Description: The Boolean query membersAreDistinguishable() determines whether all of
the namespace's members are distinguishable within it.
Expression: result = self.member->forAll( memb | self.member->excluding(memb)->forAll(other | memb.isDistinguishableFrom(other, self)))
Signature: importedMember.1() : PackageableElement;
Description: The importedMember property is derived from the ElementImports and the
PackageImports. References the PackageableElements that are members of
this Namespace as a result of either PackageImports or ElementImports.
The OCL used here is not normative.Editor's notes: Needs investigation.
Expression: Set{}
Original: result = self.importMembers(self.elementImport.importedElement.asSet()- >union(self.packageImport.importedPackage->collect(p | p.visibleMembers())))
Signature: importMembers(imps : PackageableElement; ) : PackageableElement;
Description: The query importMembers() defines which of a set of PackageableElements
are actually imported into the namespace. This excludes hidden ones, i.e.,
those which have names that conflict with names of owned members, and also
excludes elements which would have the same name when imported.
The OCL used here is not normative.Editor's notes: Needs examination.
Expression: Set{}
Original: result = self.excludeCollisions(imps)->select(imp | self.ownedMember->forAll(mem | mem.imp.isDistinguishableFrom(mem, self)))
Signature: getNamesOfMember(element : NamedElement; ) : String;
Description: The query getNamesOfMember() gives a set of all of the names that a member
would have in a Namespace. In general a member can have multiple names
in a Namespace if it is imported more than once with different aliases.
The query takes account of importing. It gives back the set of names that
an element would have in an importing namespace, either because it is owned,
or if not owned then imported individually, or if not individually then
from a package. The query getNamesOfMember() takes importing into account.
It gives back the set of names that an element would have in an importing
namespace, either because it is owned, or if not owned then imported individually,
or if not individually then from a package.
The OCL used here is not normative.Editor's notes: includes not include
Expression: result = if self.ownedMember ->includes(element)
then Set{}->includes(element.name)
else let elementImports: ElementImport = self.elementImport->select(ei | ei.importedElement = element) in
if elementImports->notEmpty()
then elementImports->collect(el | el.getName())
else self.packageImport->select(pi | pi.importedPackage.visibleMembers()->includes(element))-> collect(pi | pi.importedPackage.getNamesOfMember(element))
endif
endif
Original: result = if self.ownedMember ->includes(element) then Set{}->include(element.name) else let elementImports: ElementImport = self.elementImport->select(ei | ei.importedElement = element) in if elementImports->notEmpty() then elementImports->collect(el | el.getName()) else self.packageImport->select(pi | pi.importedPackage.visibleMembers()->includes(element))-> collect(pi | pi.importedPackage.getNamesOfMember(element)) endif endif
Signature: excludeCollisions(imps : PackageableElement; ) : PackageableElement;
Description: The query excludeCollisions() excludes from a set of PackageableElements
any that would not be distinguishable from each other in this namespace.
Expression: result = imps->reject(imp1 | imps.exists(imp2 | not imp1.isDistinguishableFrom(imp2, self)))
Send questions or comments to
[email protected].