[TransWarp] Basic Concepts for using XMI/UML/etc
Phillip J. Eby
pje at telecommunity.com
Fri May 30 05:10:10 EDT 2003
At 09:23 PM 5/29/03 +0200, Ulrich Eck wrote:
>Hi Phillip,
>
>after i implemented a fairly simple stateful workflow i found that this is
>not
>sufficient for my needs. after some researches, the StateMachines of UML
>would fit the requirements much more.
>the UML-metamodel specifies all elements of a statemachine and i could load
>them via a XMI file.
>
>the generated peak.metamodel elements do not have any implementation.
>i wanted to ask how you expect to make use of e.g. uml elements,
>imported via xmi.
There are several possible approaches. Module inheritance is relatively
straightforward; just create a package and inherit from the existing UML13
or UML14 package, and add methods to the appropriate classes. Then use
your package as the metamodel for the XMI load.
Another technique is to use the new adapt() mechanisms and write adapter
classes for the data elements.
>will you advise somehow the imported elements to give them behaviour
>(on the fly or after you generated code from xmi)?
Well, as I said, you can mix behavior into the metamodel. That behavior
could be code generation methods, or it could be methods to actually
execute something. It's all up to you.
>or do you expect to "interpret" the information you get from the imported
>elements.
You can do that, too. :) The current setup was written to support pretty
much any approach you want.
>is the current state of the metamodels package usefull for anything right
>now that i could play with e.g. implementing the logic for a statemachine
>that "executes" the uml-defined information.
Sure. As I said, just add your domain logic to the metamodel, and you can
do whatever you want. Alternatively, you can treat a loaded XMI file as
raw data, and write a processor that does whatever you want with it, like
generate code or reports or whatever.
More information about the PEAK
mailing list