|
From: Frank V. C. <fr...@co...> - 2000-09-06 23:48:16
|
I believe you have the sense of it.
A general UML of the abstraction is:
Ontology <>----> MetaClass <>----->MetaAttributes <>--|
^ |
| |
-------------------------------
So an Onotlogy has MetaClasses
MetaClasses are defined MetaAttributes
MetaAttributes are constrained (restricted) by MetaClasses
So, in psuedo-think :)
MetaClass
declares TypeOf MetaClass
declares Name String
declares ClassType Entity
declares Description String
Going along this line, and instance model could be
MetaTypeRoot
defines TypeOf {0}
defines Name "MetaTypeRoot"
defines Description "Root of the ontology"
MetaTypeNumber
defines TypeOf {MetaTypeRoot}
defines Name "MetaTypeNumber"
defines ClassType Number
defines Description "Number Type"
MetaTypeInteger
defines TypeOf {MetaTypeNumber}
defines Name "MetaTypeInteger"
defines ClassType Integer
etc.
Which would map to:
class Entity;
class Number : public Entity;
class Integer : public Number;
of course at some point in the MetaType hierarchy you determine when to
add attributes which, in effect, specialize it from it's parent(s).
Christophe Prud'homme wrote:
>
> Hie
> my understanding of the requirements for meta class is that
> it provides :
> 1- traits: static features of a type (traits were originally defined by
> Nathan Meyers)
> 2- more sophisticated RTTI
>
> it my codes I have, I think, something like that for point 2
> all objects are clearly defined within a hierarchy of class and each of them
> defines isTypeOf(char*), getClassName() , isA(char*) and the parent,child is
> defined.
>
> for point 1 traits are a very powerful and simple technique to store static
> features and I use them very often.
>
> here is a simple example
>
> template<int Dim, int charSize=8, typename T=double>
> class traits
> {
> public:
> enum { dimension = Dim };
> enum { char_size = charSize };
> typedef T T_numtype;
> };
>
> template<typename Traits>
> class A
> {
> public:
> enum { dimension = Traits::dimension };
> enum { char_size = Traits::char_size };
> typedef typename Traits::T_numtype T_numtype;
> };
>
> template<int Dim>
> class B: public A<traits<Dim> >
> {
> public:
> typedef A<Traits<Dim> > super;
> enum { dimension = super::dimension };
> enum { char_size = super::char_size };
> typedef typename super::T_numtype T_numtype;
> };
>
>
> am I correct in that it is providing 1 and 2 ?
> C.
>
> --
> Christophe Prud'homme |
> MIT, 77, Mass Ave, Rm 3-243 | C'est de la buche?
> Cambridge MA 02139 | Non c'est kloug!
> Tel (Office) : (00 1) (617) 253 0229 | C'est colmatté avec du schpountz...
> Fax (Office) : (00 1) (617) 258 8559 | -- Le Pere Noel est une ordure
> http://augustine.mit.edu/~prudhomm |
> Following the hacker spirit
> _______________________________________________
> Corelinux-develop mailing list
> Cor...@li...
> http://lists.sourceforge.net/mailman/listinfo/corelinux-develop
--
Frank V. Castellucci
http://corelinux.sourceforge.net
OOA/OOD/C++ Standards and Guidelines for Linux
http://PythPat.sourceforge.net
Pythons Pattern Package
|