[Uml-devel] uml objects

Andrew Sutton ansutton at kent.edu
Wed Oct 16 07:25:05 UTC 2002


well, i was chunking through the uml objects last night and realized that i 
was going about it all wrong. i'd finished (to some degree) a good couple 
dozen classes when i noticed that alot of the relationships and attributes i 
was implementing could be nicely abstracted out into patterns using 
templates. it almost works very, very nicely - except for a bug in my crappy 
older version of g++. i don't know how it happens - it makes absolutely no 
sense - some deeply nested stl construct (_Rb_tree<>) is actually 
*extracting* nested types from a template.

i've got this:

std::set<uml::ref<T> >.insert( iterator, const uml::ref<T> & );

not big deal. anyway, deep in the guts of stl its somehow trying to construct 
T with a "const uml::ref<T> &" parameter. i can't figure out how it got T out 
of there. its just not possible. so, i figure its a compiler bug and i'm 
upgrading to g++ 3.2 today. shouldn't take too long. haha.

anyways, if anybody has some good ideas about how to define template classes 
that model relationships, i'd love to hear them. for example, in 
bidirectional relationships, adding adding a link object to one class means 
that you're going to be adding it to the other. removing it means the same 
thing. then, of course, we get to the fun part where relationships have 
muliplicities, so a 0..1 has a different interface than a 1..n. thoughts? 
anyway, i'm excluding bidrectional link management for right now. its too 
much. if i can get this to work, then creating all the uml (and MOF) objects 
should be cake.

andy




More information about the umbrello-devel mailing list