Software Disclaimer

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, TemplateableElement

Direct Subclasses: StructuredClassifier, Signal, Interface, InformationItem, DataType, BehavioredClassifier, Association, Artifact

Class Precedence List: Classifier, Namespace, Type, PackageableElement, ParameterableElement, RedefinableElement, NamedElement, TemplateableElement, Element

Properties:

attribute : Property (0 *); -- source Classifier
collaborationUse : CollaborationUse (0 *); -- source Classifier
feature : Feature (0 *); -- source Classifier
general : Classifier (0 *); -- source Classifier
generalization : Generalization (0 *); -- source Classifier
inheritedMember : NamedElement (0 *); -- source Classifier
isAbstract : Boolean (1 1); -- source Classifier
isFinalSpecialization : Boolean (1 1); -- source Classifier
ownedTemplateSignature : RedefinableTemplateSignature (0 1); -- source Classifier
ownedUseCase : UseCase (0 *); -- source Classifier
powertypeExtent : GeneralizationSet (0 *); -- source Classifier
redefinedClassifier : Classifier (0 *); -- source Classifier
representation : CollaborationUse (0 1); -- source Classifier
substitution : Substitution (0 *); -- source Classifier
templateParameter : ClassifierTemplateParameter (0 1); -- source Classifier
useCase : UseCase (0 *); -- source Classifier
elementImport : ElementImport (0 *); -- source Namespace
importedMember : PackageableElement (0 *); -- source Namespace
member : NamedElement (0 *); -- source Namespace
ownedMember : NamedElement (0 *); -- source Namespace
ownedRule : Constraint (0 *); -- source Namespace
packageImport : PackageImport (0 *); -- source Namespace
package : Package (0 1); -- source Type
visibility : VisibilityKind (1 1); -- source PackageableElement
owningTemplateParameter : TemplateParameter (0 1); -- source ParameterableElement
isLeaf : Boolean (1 1); -- source RedefinableElement
redefinedElement : RedefinableElement (0 *); -- source RedefinableElement
redefinitionContext : Classifier (0 *); -- source RedefinableElement
clientDependency : Dependency (0 *); -- source NamedElement
name : String (0 1); -- source NamedElement

The name of the NamedElement.

nameExpression : StringExpression (0 1); -- source NamedElement
namespace : Namespace (0 1); -- source NamedElement
qualifiedName : String (0 1); -- source NamedElement
templateBinding : TemplateBinding (0 *); -- source TemplateableElement
ownedComment : Comment (0 *); -- source Element
ownedElement : Element (0 *); -- source Element
owner : Element (0 1); -- source Element

Constraints:

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].