Abstract Class UML 2.4.1::Classifier
Description:
A classifier is a classification of instances - it describes a set of instances
that have features in common. A classifier can specify a generalization
hierarchy by referencing its general classifiers.A classifier has the capability
to own use cases. Although the owning classifier typically represents the
subject to which the owned use cases apply, this is not necessarily the
case. In principle, the same use case can be applied to multiple subjects,
as identified by the subject association role of a use case.Classifier
is defined to be a kind of templateable element so that a classifier can
be parameterized. It is also defined to be a kind of parameterable element
so that a classifier can be a formal template parameter.A classifier has
the capability to own collaboration uses. These collaboration uses link
a collaboration with the classifier to give a description of the workings
of the classifier.
Direct Superclasses: Namespace,
Type,
RedefinableElement,
TemplateableElementDirect Subclasses: StructuredClassifier,
Signal,
Interface,
InformationItem,
DataType,
BehavioredClassifier,
Association,
ArtifactClass Precedence List: Classifier,
Namespace,
Type,
PackageableElement,
ParameterableElement,
RedefinableElement,
NamedElement,
TemplateableElement,
ElementProperties:
![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
attribute :
Property (0 *); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
collaborationUse :
CollaborationUse (0 *); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
feature :
Feature (0 *); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
general :
Classifier (0 *); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
generalization :
Generalization (0 *); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
inheritedMember :
NamedElement (0 *); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
isAbstract : Boolean (1 1); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
isFinalSpecialization : Boolean (1 1); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
ownedTemplateSignature :
RedefinableTemplateSignature (0 1); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
ownedUseCase :
UseCase (0 *); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
powertypeExtent :
GeneralizationSet (0 *); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
redefinedClassifier :
Classifier (0 *); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
representation :
CollaborationUse (0 1); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
substitution :
Substitution (0 *); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
templateParameter :
ClassifierTemplateParameter (0 1); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
useCase :
UseCase (0 *); -- source
Classifier![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
elementImport :
ElementImport (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
importedMember :
PackageableElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
member :
NamedElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
ownedMember :
NamedElement (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
ownedRule :
Constraint (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
packageImport :
PackageImport (0 *); -- source
Namespace![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
package :
Package (0 1); -- source
Type![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
visibility :
VisibilityKind (1 1); -- source
PackageableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
owningTemplateParameter :
TemplateParameter (0 1); -- source
ParameterableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
isLeaf : Boolean (1 1); -- source
RedefinableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
redefinedElement :
RedefinableElement (0 *); -- source
RedefinableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
redefinitionContext :
Classifier (0 *); -- source
RedefinableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
clientDependency :
Dependency (0 *); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
name : String (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
nameExpression :
StringExpression (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
namespace :
Namespace (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
qualifiedName : String (0 1); -- source
NamedElement![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
templateBinding :
TemplateBinding (0 *); -- source
TemplateableElement![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
ownedComment :
Comment (0 *); -- source
Element![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
ownedElement :
Element (0 *); -- source
Element![](/se-interop/image/down-arrow.png?hunchentoot-session=9708%3AA8D12BD3EE10937625206AF5E0328CAB)
owner :
Element (0 1); -- source
ElementConstraints:
Signature: specialize_type() : Boolean;
Description: A classifier may only specialize classifiers of a valid type.
Expression: self.parents()->forAll(c | self.maySpecializeType(c))
Signature: non_final_parents() : Boolean;
Description: The parents of a classifier must be non-final.
Expression: self.parents()->forAll(not isFinalSpecialization)
Signature: no_cycles_in_generalization() : Boolean;
Description: Generalization hierarchies must be directed and acyclical. A classifier
can not be both a transitively general and transitively specific classifier
of the same classifier.
Expression: not self.allParents()->includes(self)
Signature: maps_to_generalization_set() : Boolean;
Description: The Classifier that maps to a GeneralizationSet may neither be a specific
nor a general Classifier in any of the Generalization relationships defined
for that GeneralizationSet. In other words, a power type may not be an
instance of itself nor may its instances also be its subclasses.
Expression: true
Operations:
Signature: parents() : Classifier;
Description: The query parents() gives all of the immediate ancestors of a generalized
Classifier.
The OCL used here is not normative.Editor's notes: self.generalization is a Set, we want the general of each of its elements.
Expression: result = generalization->collect(general)
Original: result = generalization.general
Signature: maySpecializeType(c : Classifier; ) : Boolean;
Description: The query maySpecializeType() determines whether this classifier may have
a generalization relationship to classifiers of the specified type. By
default a classifier may specialize classifiers of the same or a more general
type. It is intended to be redefined by classifiers that have different
specialization constraints.
The OCL used here is not normative.Editor's notes: oclType() not oclType. No such operator in OCL AFAIK. But I have one for this purpose.
Expression: result = self.oclIsKindOf(c.oclType())
Original: result = self.oclIsKindOf(c.oclType)
Signature: isTemplate() : Boolean;
Description: The query isTemplate() returns whether this templateable element is actually
a template.
The OCL used here is not normative.Editor's notes: Templateable not Templatable.
Expression: result = oclAsType(TemplateableElement).isTemplate() or general->exists(g | g.isTemplate())
Original: result = oclAsType(TemplatableElement).isTemplate() or general->exists(g | g.isTemplate())
Signature: inheritedMemberAux() : NamedElement;
Description: The inheritedMember association is derived by inheriting the inheritable members of the parents.
Editor's notes: This is a new function defined to correct the problem of non-progressing recursion
of the normative inheritedMember.1
Expression: result = let directs = self.parents()->reject(x | x.visibility = #private) in
if directs->isEmpty()
then directs
else directs->collect(x | x.inheritedMemberAux())->union(directs) endif
Signature: inheritedMember.1() : NamedElement;
Description: The inheritedMember association is derived by inheriting the inheritable
members of the parents. The inheritedMember association is derived by inheriting
the inheritable members of the parents.
The OCL used here is not normative.Editor's notes: I rewrote inheritedMember to not use inheritableMembers and hasVisibilityOf.
These produce an non-progressing recursion (calling each other with no change in arguments).
Expression: result = self.inheritedMemberAux()->asSet()
Original: result = self.inherit(self.parents()->collect(p|p.inheritableMembers(self))->asSet())
Signature: inheritableMembers(c : Classifier; ) : NamedElement;
Description: The query inheritableMembers() gives all of the members of a classifier
that may be inherited in one of its descendants, subject to whatever visibility
restrictions apply.
The OCL used here is not normative.Editor's notes: I rewrote inheritedMember to not use inheritableMembers and hasVisibilityOf.
These produce an non-progressing recursion (calling each other with no change in arguments).
Expression: Set{}
Original: c.allParents()->includes(self)
result = member->select(m | c.hasVisibilityOf(m))
Signature: inherit(inhs : NamedElement; ) : NamedElement;
Description: The inherit operation is overridden to exclude redefined properties. The
query inherit() defines how to inherit a set of elements. Here the operation
is defined to inherit them all. It is intended to be redefined in circumstances
where inheritance is affected by redefinition.
Expression: result = inhs
Signature: hasVisibilityOf(n : NamedElement; ) : Boolean;
Description: The query hasVisibilityOf() determines whether a named element is visible
in the classifier. By default all are visible. It is only called when the
argument is something owned by a parent.
The OCL used here is not normative.Editor's notes: I rewrote inheritedMember to not use inheritableMembers and hasVisibilityOf.
These produce an non-progressing recursion (calling each other with no change in arguments).
Expression: Set {}
Original: self.allParents()->including(self)->collect(c | c.member)->includes(n)
result = (n.visibility <> VisibilityKind::private)
Signature: general.1() : Classifier;
Description: The general classifiers are the classifiers referenced by the generalization
relationships.
Expression: result = self.parents()
Signature: conformsTo(other : Classifier; ) : Boolean;
Description: The query conformsTo() gives true for a classifier that defines a type
that conforms to another. This is used, for example, in the specification
of signature conformance for operations.
Expression: result = (self=other) or (self.allParents()->includes(other))
Signature: allParents() : Classifier;
Description: The query allParents() gives all of the direct and indirect ancestors of
a generalized Classifier.
The OCL used here is not normative.Editor's notes: Missing close paren.
Expression: result = self.parents()->union(self.parents()->collect(p | p.allParents()))
Original: result = self.parents()->union(self.parents()->collect(p | p.allParents())
Signature: allFeatures() : Feature;
Description: The query allFeatures() gives all of the features in the namespace of the
classifier. In general, through mechanisms such as inheritance, this will
be a larger set than feature.
Expression: result = member->select(oclIsKindOf(Feature))
Send questions or comments to
[email protected].