[Uml-devel] more insanity
Luis De la Parra Blum
lparrab at gmx.net
Fri Nov 8 09:30:02 UTC 2002
well.. this is getting confusing =)
what about this:
> so, in the XMI listing:
>
> <Model:Package annotation="" isAbstract="false" isLeaf="false"
> isRoot="false" name="Model" visibility="public_vis" xmi.id="a9">
> <Model:ModelElement.constraints>
> <Model:Constraint xmi.idref="a10"/>
> <Model:Constraint xmi.idref="a11"/> <-- parse state is here
> <Model:Constraint xmi.idref="a12"/>
> <Model:Constraint xmi.idref="a13"/>
> </Model:ModelElement.constraints>
>
after parsing the document we start walking the tree and do something like:
MOF::Package *p = new MOF::Package(/*id=*/ "a9");
p->setAbstract(false);
p->setLeaf(false);
...
//parentElement is the element "in which" we currently are (can be the Model
// a package, or a class...
parentElement->add(p);
//if there were no parentElement, ie, if we just found the first element
//we would have called Model::setTopElement(p) or something like that
//parse the rest of the file and finaly return the model we just created to
//the caller
return Model;
ok, ok, so this is not reflective and maybe my approach is much more
simplistic, but if in the MOF there are only a few "building blocks"
(package, object, association) this would be all that we need.
we can get MOF going, and then we use the MOF code generator to write
the UML metamodel for us (which has many more elements)
hm... somehow I have the feeling I am talking nonsense here, but why cant we
just keep it simple?
luis
More information about the umbrello-devel
mailing list