Hi Tony,

Thanks for the clear explanation. This is really great stuff. I just did a
test with creating a class and attribute and exported this to XMI. It works
just fine!
I'll get back to the list to tell you about other results. It looks very
promising though...

cheers,

Rudie Ekkelenkamp.

-----Oorspronkelijk bericht-----
Van: Tony Mowers [mailto:[EMAIL PROTECTED]
Verzonden: dinsdag 9 september 2003 10:07
Aan: Rudie Ekkelenkamp; [EMAIL PROTECTED]
Onderwerp: RE: [Andromda-user] Adding model elements to the MDR



We sure are getting a heap of MDR related questions :-)

What you are talking about is very possible using AndroMDA.  Matthias and I
exchanged e-mails with the Middlegen architect sometime back talking about
exactly this sort of thing.  He didn't really have much interest in it.  My
impression was that he has his own ways of doing the reverse engineering and
so he wasn't too interested in AndroMDA for that sort of stuff.

I still think it is a good idea and I built the API in the AndroMDA
repository so that this is something that could be done.  Here is how I
would recommend you do it ...

AndroMDA can accept in it's build.xml file a <repository> tag which can be
used to plug in your own Repository implementaton into AndroMDA.  I
recommend you subclass the existing AndroMDA MDR repository and plug in your
own.

If you take a look at the org.andromda.core package you will find the
MDRespositoryFacade class.  You should have a look at it's implementation.
The class implements a method called readModel(URL modelURL) which takes as
a parameter the URL to the XMI file for your model.  If you look at the
implementation for that method it actually uses an XMIReader to read in the
model from the URL.  What you can do is build a reader of you own invention
that is able to read whatever sits at the specified URL and use the data at
that URL to populate the MDR repository. You should be able to do all of
this without having to recompile any of the AndroMDA source code.

The way you populate the MDRepository is by using the API of the classes
that sit in the UML14.jar.  There exist classes such as the UmlPackageClass
and UmlClassClass that enable you to manufacture Uml meta-objects.  For an
example of how to manufacture UML1.4 meta-objects have a look at the file:

  src/test/org/andromda/mdr/MDRepositoryTransformationTest.java

It shows an example of an Attribute being created dynamically and being
added to a class.

One could imagine the modelURL of the readModel method pointing to a JDBC
accessable database. One could then imagine reading the database tables and
creating classes in the model for each table and creating attributes on
these classes for each column in the table.  This would then reverse
engineer the database schema and could be used by any AndroMDA cartridge to
do code generation.  This is all possible just by plugging in your own
repository implementation.

Tony



> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Rudie
> Ekkelenkamp
> Sent: Monday, September 08, 2003 11:42 PM
> To: '[EMAIL PROTECTED]'
> Subject: [Andromda-user] Adding model elements to the MDR
>
>
> Hi,
>
> I'v been following the discussions on the usage of the MDR and how it is
> integrated with AndroMDA and it has been very interesting.
> I'v been thinking of using the MDR myself for a reverse engineering task.
> What I intend to do is to write model elements to the MDR and use the MDR
> facility to export a XMI file that can be used by AndroMDA again. I can
> imagine that a tool like middlegen could use a similar stragegy?
> What I would like to know is what would be the best way to create my model
> elements. The AndroMDA proxy classes can't be used since the constructors
> expect already constructed model classes.
> Should I implement all interfaces for the model elements I want
> to use like
> for example the UMLClassifier for classifiers? Is there any easy way to do
> this?
> Alternatively I could write my own XMI but I would like to avoid that.
>
> Any help would be appreciated.
>
> cheers,
>
> Rudie Ekkelenkamp
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Andromda-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/andromda-user


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Andromda-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to