Is model driven architecture worth it and what is the state of the art in the tooling?
Asked Answered
O

4

6

We have a recurring problem in our shop where we end up with 3 or 4 different representations of the same class/entity.

A java version, an xml version, a hibernate version, a json version... you get the point.

Obviously this creates maintenance problems.

Model driven architecture is probably more than this, but what I'd really like is a system that lets me define a class or an entity once, in one way, and then generate various representations. (maybe I am not using the correct terminology for this)

It really isn't that straight forward, of course, because let's say we have a java object that we want to turn into JSON for sending over the wire - there might not be an exact 1-1 correspondence between the members in the java object to the fields in JSON - there might be some optimizations, or whatever.

I've looked at things like AndroMDA and EMF in the past, and found them either lacking or clumsy. I do not know how they stack up these days, or what other systems there are.

What are SO's opinions on MDA and or meta-data driven programming? Have the tools become mature enough for serious consideration?

Thanks.

Oyez answered 1/3, 2012 at 20:9 Comment(1)
See also #4480383 and #696521 and #21591 and #71281Monkery
F
1

Check out Naked Objects

http://nakedobjects.codeplex.com/

and it's apache equivalent

http://isis.apache.org/index.html

The fact that both of these frameworks are almost unheard of should answer your question IMHO. I think ending up with inconsistent representations of the same objects indicates a flaw in your process, which isn't something you should try and solve with a framework.

Floro answered 1/3, 2012 at 22:34 Comment(1)
This answer hinges on an unsupported argument.Henrietta
S
7

As a contributor to both Naked Objects and Apache Isis, I can confirm the other answer from @dnellis74 given that these both address the issue of having multiple representations of the same thing; with these frameworks you write your domain object once, and then it is reflected automatically to the user as a persistence layer.

Of course, (and I would say this, wouldn't I?) I don't agree with @dnellis74 that the fact that these frameworks are little known means that they should be dismissed out of hand; you should decide for yourself.

One other point that might be of interest; both these frameworks are in the process of implementing the Restful Objects spec, which aims to expose your domain objects automatically via a RESTful API, and let you skin it or integrate with it as you see fit. The .NET impl is pretty complete, the Java impl is lagging a bit but even so has a demo that you can check out.

As for MDA, I was sceptical from the outset when it was first being tauted by the OMG, to the extent that I wrote an article about it on TheServerSide. I think I called it right.

Dan

Slopwork answered 7/3, 2012 at 21:6 Comment(0)
S
2

To address your core concern, you can define a Java class for your domain object. Then, you can annotate the class with JAXB and Hibernate annotations. This way you have a single definition of your entity(the Java class) that can be output in various representations, JAXB for JSON and XML, Hibernate for persistence.

Skean answered 1/3, 2012 at 20:20 Comment(0)
F
1

Check out Naked Objects

http://nakedobjects.codeplex.com/

and it's apache equivalent

http://isis.apache.org/index.html

The fact that both of these frameworks are almost unheard of should answer your question IMHO. I think ending up with inconsistent representations of the same objects indicates a flaw in your process, which isn't something you should try and solve with a framework.

Floro answered 1/3, 2012 at 22:34 Comment(1)
This answer hinges on an unsupported argument.Henrietta
E
1

Despite it is old question I would like to answer it from today MDA standpoint.

The short answer to your question in title "Is model driven architecture worth it and what is the state of the art in the tooling?" is "Yes".

The longer answer is "you need to change your approach to development to be MDA based, which requires some investments, but it worth it".

Epi answered 2/3, 2020 at 6:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.