Difference between revisions of "XCSG:Namespace"
(switching to metaclass template) |
(XCSG.Namespace now extends Node) |
||
(10 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | A Namespace “owns” the model elements that appear in it, and no model element may appear in more than one namespace. | + | A Namespace “owns” the model elements that appear in it, and no model element may appear in more than one namespace. It's important to note however that although a Namespace "owns" the model element, at runtime an instance of the namespace may own an instance of the model element. For example each call to a function would allocate it's own instance of a local variable in the stack. Similarly a namespace is not necessarily a scope. |
− | + | Each Package has a name (inherited from [[Node]]), and is connected by [[Contains]] edges to software elements defined in that Package. Software elements connected in one step over [[Contains]] edges are top-level elements in that Package. Not every software element contained in a Package is visible in or beyond that package, those that may be visible are tagged with a [[Visibility]] modifier indicating their declared (or implicit) visiblity. | |
− | + | ||
− | + | ||
Subtypes of Namespace may restrict the types of model elements that the name space contains. | Subtypes of Namespace may restrict the types of model elements that the name space contains. | ||
Line 9: | Line 7: | ||
== Specification == | == Specification == | ||
− | {{ | + | {{Node |
− | | extends = | + | | extends = Node |
| description = A model element that contains (owns) a set of uniquely named model elements. Each contained element is owned by at most a single namespace. The concrete subclasses of Namespace constrain the type of elements the Namespace may contain. Namespace is an abstract metaclass. | | description = A model element that contains (owns) a set of uniquely named model elements. Each contained element is owned by at most a single namespace. The concrete subclasses of Namespace constrain the type of elements the Namespace may contain. Namespace is an abstract metaclass. | ||
| references = [5, p. 2-14, Figure 2-5], [5, pp. 2-49, 2-68] | | references = [5, p. 2-14, Figure 2-5], [5, pp. 2-49, 2-68] | ||
}} | }} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 15:40, 2 October 2015
A Namespace “owns” the model elements that appear in it, and no model element may appear in more than one namespace. It's important to note however that although a Namespace "owns" the model element, at runtime an instance of the namespace may own an instance of the model element. For example each call to a function would allocate it's own instance of a local variable in the stack. Similarly a namespace is not necessarily a scope.
Each Package has a name (inherited from Node), and is connected by Contains edges to software elements defined in that Package. Software elements connected in one step over Contains edges are top-level elements in that Package. Not every software element contained in a Package is visible in or beyond that package, those that may be visible are tagged with a Visibility modifier indicating their declared (or implicit) visiblity.
Subtypes of Namespace may restrict the types of model elements that the name space contains.
Specification
Metaclass | Namespace |
---|---|
Extends | Node |
Description | A model element that contains (owns) a set of uniquely named model elements. Each contained element is owned by at most a single namespace. The concrete subclasses of Namespace constrain the type of elements the Namespace may contain. Namespace is an abstract metaclass. |
Direct Subkinds | Classifier, Package |
---|
All Superkinds | Node, ModelElement |
---|
Known Possible In Edges
| ||||
---|---|---|---|---|
Inherited From | In Edge | Predecessor | Multiplicity | Description |
Node | Contains | Node | 1 | Indicates that the predecessor contains the successor in a sense specified by the specific type of Contains edge. |
Known Possible Out Edges | ||||
---|---|---|---|---|
Out Edge | Successor | Multiplicity | Description | |
HasVariable | Variable | ✱ | Links a Classifier or Package to one of its Variables.
| |
Inherited From | Out Edge | Successor | Multiplicity | Description |
Node | Contains | Node | ✱ | Indicates that the predecessor contains the successor in a sense specified by the specific type of Contains edge. |