MetaClass Class
CoreLinux++ Functional
Requirement Document
Revision $Revision: 1.12 $
Last Modified : $Date: 2000/10/07 17:14:34 $
Title : MetaClass Class
1. Introduction
An Object Oriented program performs computation as a result of the
interaction of its object instances at run-time, and in the simplest Object
Model, instances have meaning only as object instances at run-time and classes
exist soley as an abstraction at compile time.
A more sophisticated Object Model enables the run-time objects to make use
of class type information, and in a pure Object Model, this information is
provided by a run-time object for each class. Each class object provides a
description of instances of it's class. Every object must be an instance of
some class, so it is necessary to define meta-classes that are instantiated as
the class objects.
Meta-classes were originally introduced for languages such as CLOS and
Smalltalk to assist in the construction of instances whose layout was entirely
defined at run-time. More efficient languages, such as C++ or Eiffel, define
object layouts at compile-time and compiler writers have no need to provide
meta-classes. The available facilities in C++ are limited but they do
exist.
Therefore a meta-class instance is used to capture (model) the type
information about a class, and subsequently, it's instances. For example, we
can consider that "aaaaa" is an instance of a ascii string, and that string is
of type MetaTypeAsciiString. Within MetaTypeAsciiString we can convey
information about constraints (upper and lower bound, each character is 8
bits, must terminate with null, etc.) as well as it's relationship to other
types. In the example, MetaTypeAsciiString can be modeled as a child of
MetaTypeString.
MetaType objects are codification of the class of a class. The behavioral
semantics of a MetaType are that of knowledge representation (KR) concepts,
and as such support general reasoning capability.
1.1 Deliverables Overview
The participants in the MetaClass Class type include:
- Entity
- Entity are the first class application/library classes that has an
association to it's type (MetaType class).
- MetaType
- MetaType is the unique instance of a meta-class which carries
information about a entity class. There is a one to one relationship
between an entity class and a MetaType class instance.
The deliverables in libclfw++ will be:
- MetaType
This is the declaration and definitions for the MetaType class
- A MetaType ontology
This is the run-time hierarchy of MetaType class instances
- The root of the ontology MetaType class instance called "MetaTypeRoot"
This will serve as the hierarchical root for all other MetaType
types.
- The basic meta-class MetaTypeNumber shall be defined as a TypeOf MetaTypeRoot
- The basic meta-class MetaTypeReal will be defined as a TypeOf MetaTypeNumber
- The basic meta-class MetaTypeUnsignedLong will be defined as a TypeOf MetaTypeReal
- The basic meta-class MetaTypeLong will be defined as a TypeOf MetaTypeReal
- The basic meta-class MetaTypeInteger will be defined as a TypeOf MetaTypeLong
- The basic meta-class MetaTypeShort will be defined as a TypeOf MetaTypeInteger
- The basic meta-class MetaTypeCharacter will be defined as a TypeOf MetaTypeString
- The basic meta-class MetaTypeString will be defined as a TypeOf MetaTypeRoot
2. Functional Requirements
The MetaType class requirements:
- MetaType shall shall require all constructors to support a unique identifier for the MetaType instance,
- MetaType shall store a immutable unique character string called Name, which is the name of the MetaType class,
- MetaType shall support URI format for Name,
- MetaType shall store a immutable character string called ClassName, which is the name of the C++ Class the MetaType represents.
- MetaType shall support null as the ClassName.
- MetaType shall support URI format for ClassName,
- MetaType shall support a mutable character string called Description,
- MetaType shall support an associative collection to other MetaTypes to realize hierarchical specialization, called "TypeOf",
- MetaType shall support adding one or more MetaTypes to the TypeOf associations,
- MetaType shall have the default MetaType: MetaTypeRoot as a TypeOf association,
- MetaType shall support removing one or more MetaTypes from the TypeOf association,
- MetaType must put MetaTypeRoot as the TypeOf association default if all others are removed,
- MetaType shall support boolean 'isType' comparison against other MetaType instances,
- MetaType isType comparison will compare itself against the other MetaType instance
- MetaType isType comparison will not compare the other MetaType instance against it's TypeOf associations,
- MetaType shall support boolean 'isTypeOf' comparisons with another MetaType instance,
- MetaType isTypeOf operation will, if isType is false, compare up through it's parentage, as defined by TypeOf associations,
- MetaType shall support non-destructive iteration over the TypeOf association,
- MetaType shall support the addition of attributes,
- MetaType shall support the removal of attributes,
- MetaType shall support the non-destructive iteration over it's attributes
The MetaType ontology requirements:
- Ontology shall view MetaTypeRoot as the base most type (Thing)
- Ontology shall support the addition of new MetaType instances
- Ontology shall insert MetaTypeRoot as the TypeOf association to newly added MetaType types
- Ontology shall maintain a dictionary of MetaType Name to MetaType instances
- Ontology shall support removing MetaType instances
- Ontology shall not allow removal of the MetaType MetaTypeRoot
The Entity requirements:
- Entity shall require a static accessor to it's MetaType class
- Entity shall support isTypeOf operations with other MetaType class
2.1 User Interface Specifications
Domain defined
2.2 Product Services
Domain defined
2.3 External Interfaces and Database Requirements
Domain defined
2.4 Error Handling
Domain defined
2.5 Foreseeable Functional Changes and Enhancements
3. Non-Functional Requirements
Precondition constraints: None
Postcondition constraints: None
Invarient constraints: None
3.1 Performance Requirements
NA
3.2 User Documentation and Other User Aids
This Document
Analysis Use-Case diagrams
Design class diagrams
3.3 Development Requirements
Standards: CoreLinux++ C++ Standards and
Guidelines
3.4 Foreseeable Non-Functional Changes
NA
4. Remarks and Guidelines for Later Life Cycle Phases
TBD
5. Term Glossary
TBD
Copyright © 1999, 2000 by CoreLinux Consortium
This material may be distributed only subject to the terms and conditions set forth in the
Open Publication License
|