views:

219

answers:

2

Hey all,

I've been wanting to have a dabble with Model Driven Architecture for a while now.

Could anyone give me any hints on how to start.

I'd love to be able to define a domain model in UML then be able to transform it to say java classes with JPA/hibernate annotations defining the data mappings.

I'd really love to get my hands dirty with some of the modeling tools on the Eclipse platform (EMF/MDT/GEF).

Thanks,

Ashley

+1  A: 

A very easy way to start in Eclipse is to create a UML model containing the classes and their operations you are designing, and then generate the Java skeletons with EMF instead of manually defining the Java classes. (Another option would be to work on the ECore-level, but I always stick to UML)

In the second step, you fill in the gaps in the generated skeletons. You can follow the EMF tutorial on this.

Use the Edit framework or any other GUI to provide data entry for the objects.

Then you might want to play with stereotypes and see how you can use them to add additional data to your model elements, e.g. to parametrise the skeleton generation from UML through ECore to Java, or for your own purposes. For example, since you already have a class diagram editor through Eclipse, you can easily whip up a plugin that will show a context menu for your stereotyped elements to do something with them.

Of course, all this becomes much more interesting if you have an actual (OO) problem to work on. Maybe you have some old code/project that you want to refactor this way?

ShiDoiSi
+1  A: 

I've been using the Eclipse EMF/GMF/GEF stack for more than a year now, and it's a very powerful set of frameworks.
As far as DB persistence goes, I have only briefly looked at Teneo, but it looks like a mature solution to persist EMF objects (EObjects) to a relational database — either directly or through Hibernate. A more conventional option would be to use Acceleo with the UML to JEE code generator module, which will generate the Hibernate ORM mapping and a Struts based UI from your UML model.

Zsolt Török