Difference between revisions of "XCSG:Classifier"

From AtlasWiki
Jump to: navigation, search
m (TheodoreMurdock moved page Classifier to XCSG:Classifier)
(remove reference to abandoned "explicit keywords" feature)
Line 2: Line 2:
  
 
Because languages differ in the semantics of specific subtypes of classifiers, XCSG does not attempt to provide specific subtypes of Classifier; instead, the role of a classifier can be distinguished by its features: if it has only abstract methods, its role is likely that of an interface, if it has only concrete methods, then it is likely a class, if it is actually constructed and used, that can usually be seen from inspecting data flow (exceptions may include construction by injection frameworks or construction by means of reflection).
 
Because languages differ in the semantics of specific subtypes of classifiers, XCSG does not attempt to provide specific subtypes of Classifier; instead, the role of a classifier can be distinguished by its features: if it has only abstract methods, its role is likely that of an interface, if it has only concrete methods, then it is likely a class, if it is actually constructed and used, that can usually be seen from inspecting data flow (exceptions may include construction by injection frameworks or construction by means of reflection).
 
To support language-specific analyses that may be interested in distinguishing specific types of classifiers in a specific language (such as interfaces from classes in Java, or those declared using the "class" keyword from those declared using the "struct" keyword in C++), all Classifiers are tagged with the language-specific [[keywords]] used to declare them.
 
  
 
== Specification ==
 
== Specification ==

Revision as of 20:40, 9 September 2014

A Classifier is a Type which may have Fields and/or Methods, such as a class, interface, or struct. They serve as templates for runtime instances, and may extend other classifiers.

Because languages differ in the semantics of specific subtypes of classifiers, XCSG does not attempt to provide specific subtypes of Classifier; instead, the role of a classifier can be distinguished by its features: if it has only abstract methods, its role is likely that of an interface, if it has only concrete methods, then it is likely a class, if it is actually constructed and used, that can usually be seen from inspecting data flow (exceptions may include construction by injection frameworks or construction by means of reflection).

Specification

Metaclass Classifier
Extends TypeNamespace
Description A model element that defines a set of structural and behavioral features, e.g. an Interface or Class.
Direct Subkinds Java:Annotation, Java:Class, Java:Interface, C:Struct
All Superkinds Namespace, Type, Node, ModelElement
Specified In Edges
In Edge Predecessor Multiplicity Description
InvokedType DynamicCallSite Connects a DynamicCallSite or Invoke node to the declared type of the object whose Method is being invoked.
Invoke
Supertype Classifier Connects a Classifier to another Classifier that it extends.

Inherited From In Edge Predecessor Multiplicity Description
Type AliasedType TypeAlias Connects a TypeAlias to the Type or TypeAlias it was declared to duplicate.

ArrayElementType ArrayType 0..1 Connects an ArrayType to the Type of elements contained by arrays of that type.
C:CompletedBy OpaqueType 1 Connects an OpaqueType to the complete definition of the corresponding Type.
ReferencedType Pointer Connects a Pointer to the Type of the data pointed to.
Returns Function Connects a Function to the Type of its return value (which may be Void).
TypeOf Variable Links a Variable or DataFlow node to its Type

DataFlow (Node)
Specified Out Edges
Out Edge Successor Multiplicity Description
HasVariable ProgramVariable Links a Classifier or Package to one of its Variables.
InstanceVariable
Supertype Classifier Connects a Classifier to another Classifier that it extends.

Inherited From Out Edge Successor Multiplicity Description
Type TypeChecked InstanceOf Connects a Type (usually a Classifier) to an InstanceOf test.
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

Inherited From Out Edge Successor Multiplicity Description
Namespace HasVariable Variable Links a Classifier or Package to one of its Variables.
Node Contains Node Indicates that the predecessor contains the successor in a sense specified by the specific type of Contains edge.