MDA for Groovy using EMF

During the past few weeks I have read through loads of material regarding MDA, especially the Eclipse Modelling Framework (EMF) and all the tools around it... this is the way to go IMO!
In the coming weekend I will start work on a Ecore -> Groovy Domain Class transformation, using oAW templates (looks very easy!). Next step is to enable application of annotations (or similar approach?) to the model to indicate such things as contraints, searchable and the other groovy specific DC "stuff"! perhaps also operations to closures?

I'm considering making a more loosely coupled constraints framework, where the constraints are defined in a separate model and then mapped to the Domain Classes for reuse. Fx enablecreation of ConstraintClass "UserName" (in ecore model) with constraints of unique, minlength, regEx etc. Such a ConstraintClasses could then be extended and referenced by the static constraints closures of multiple DCs. What do you think?
I see there is a Java2Ecore tool. Why not a Groovy2Ecore tool??? Ideas are flowing...

 Kristian

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Mar 13, 2008

    nurul choudhury says:

    I am really happy to read this post, I have been thinking along the same lines. ...

    I am really happy to read this post, I have been thinking along the same lines. I am rather new to GRAILS and I am not sure the best way to do this. I would be very interested in helping out. I have started experimenting with a plugin for an improved scaffold generator. I am not sure that I am approaching it in the correct manner, but I will make the code available shortly.

     I believe the the scaffold generated for am application should not simply be a set of pages for record level CRUD operations but take into account the relationships that have been defined. The problem that I ma facing is that the current relationship model does not give enough metadat to do a really good job of good application scaffolding. It is my opinion that giver only a little more information 70% - 80% of many simple database application can be generated automatically generated.

    Further the scaffolding uses AJAX to give a modern responsive interface. The amount code that is generated is not a great deal, but for someone whho does not know grails will, it give a great starting point for further development. 

    I also believe that the basic security of an an application can also be automatically generated. The access rights to an application is often referred to as functional and data entitlements. The modern trend in managing entitlements is to use a rule based entitlements. I such a system we would define

  2. Mar 14, 2008

    Jim Mason says:

    I would be interested in helping test this framework as soon as you have somethi...

    I would be interested in helping test this framework as soon as you have something to work with. This is a top priority for us and using EMF makes sense because many tools and Eclipse can work with the EMF models.

    I've built similar Java MDG frameworks reading databases, generating an intermediate representation ( DDW not EMF) and then generating Java domain classes with lookup arguments. A rules-based mapping is critical because of support required for non-standard legacy data models that COULD be mapped to a valid unique key path for automated persistence management. Let me know... Thanks...

  3. Mar 18, 2008

    Guido Schmutz says:

    Some work for using Open ArchitectureWare (oAW) for generating Grails applicatio...

    Some work for using Open ArchitectureWare (oAW) for generating Grails applications has already been done and is available on the Fornax Platform. Don't know if you are aware of that.
    There is a Grails cartridge which can be downloaded from here (http://www.fornax-platform.org/cp/display/fornax/Grails+%28CGR%29). Unfortunately I haven't been able to test it yet, so I can not tell you how useful this cartridge is at the moment.

  4. Mar 22, 2008

    Rick Reumann says:

    I'm curious... how much actual time (as a percentage) can be saved by using MDA ...

    I'm curious... how much actual time (as a percentage) can be saved by using MDA approaches to software development on a large project (not a simple mom-and-pop shopping cart).  I'm not against MDA and I do think it can  help some - but I do not see it as some silver bullet that so many corporate managers think it is (I'm not saying anyone here that has posted has stated as such either.)  I equate it more to the equivalent of the benefit of the setter/getter construction that an IDE does for you - it saves some time by relieving the developer of mundane things, but it's never where the crux of the real time is spent on a project. Nobody minds alleviating the tasks that most developers could do in their sleep - which I equate now to the basic flow of a simple CRUD operation from an html form to the persistence layer, but those aren't the things that take up most of a developer's time.

    Maybe I've been unfortunate, but every project I have been on, the real time was always spent on the business logic complexity or the goofy quirks that come up between the front end components and what the midtier has to handle related to user requirments. I wish the majority of corporate projects involved just simple CRUD functionality where your front end mapped up nicely to your domain model.

    In my experience it's always ended up with "The business wants to be able to select a 'yes/no' radio button, and when they select yes, and belong to the topDog role, you also need to make sure to modify this extra flag on a column in the db, unless it happens to be a full moon, at which point you check the value of some other property on the user and see if it's greater than the company's start date, at which point you need to make sure a special alert is displayed and you don't save the original form data, but make sure you do save some content to a different table with questions 4 and 5 on the form - and include question 8 on the form if they are from Florida." This is the kind of stuff that chews up most of a developer's time. Yea, it's cool you can get mundane functionality handled by things like scaffolding and maybe going a bit further with MDA, but in the end does it really give you that much time savings? Again, don't get me wrong, I think it's killer that stuff like scaffolding exists and it's awesome for getting you up and running quickly, I just have to laugh though when managers think "Oh cool, we can use MDA. We can press a button and it will build 90% of the application for us. We're going to save so much time and money using it!." From my experience, though, it's never the mundane stuff that takes up the bulk of the time on project development (not that I don't appreciate being alleviated from mundane tasks, I'm all for it.)