Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » Where to start with Eclipse Modelling Projects
Where to start with Eclipse Modelling Projects [message #619738] Fri, 09 July 2010 11:36 Go to next message
Nos Doughty is currently offline Nos DoughtyFriend
Messages: 4
Registered: July 2010
Location: United Kingdom
Junior Member
Hi,

I have a project I am working on and have come to the conclusion that the idea of MDA is more practical than I have previously thought. I have been exploring writing some custom code generators using FMPP and Ant tasks, and after checking out MDA came across a webcast of Acceleo in Helios and am starting to realise that 'doing MDA properly' might not be as scary as I thought ;)

I'm very excited about the all the technology in the Eclipse Modelling Project, but am not sure where to start learning from as some of the projects seem to complement each other and some have overlapping functionalities.

I'll explain briefly what I have in mind, and I would greatly appreciate some guidance on:
1) Which technologies are suitable for each task, and
2) which learning resources should I used for each chosen technology.

There are two aspects where I want to involve modelling in my Project.

1a) I have a Eclipselink(JPA2) based domain model which needs generation. I am using the JEE6 standards but using an architecture inspired by Adam Bien's book 'Real World Java EE Patterns' and ECB in general, along with a style of code which results in 'fluent' interfaces and special annotations which are used to add semantic metadata to be consumed as part of unit testing to check compliance of the resulting classes to constraints (eg, @Immutable, @Factory) - so a standard JEE generator is not what I am after - but might server as a useful basis if it can be easily modified.

Along with this I have a custom built DTO/Presentation layer library which compounds the JPA entities into abstract workflows and then some factories turn this into concrete screen widgets/events - currently I am using Vaadin as a view technology and would like to code generate portions of this too.

I'm really after a visual model for this, and am happy to use some sort of UML tool to create the model. The complication is that I want to model to hold some additional semantics for the domain over and above standard JPA information as I want the generator to take into account some usage constraints for generating the 'Control' elements (such as implementing paging for large collections but not for small, and differentiating between owned collections and un-owned ones with more than just the 'private ownership' metadata in JPA.

Assuming I can use UML for this, I suppose I would proceed by finding a UML tool (like Poseidon) and making my model, exporting it as XMI and then using Acceleo to general Java code. I will need to modify the JEE generator aspect to produce the output I have in mind.

1b) If it's not too much work though, I'd be happy with another level of abstraction. I'd *love* to be able to create my own visual model of an application, then do some sort of model-to-model transformation into the UML used to generate the actual java files. Then the UML model used for the generation would need to contain less semantic metadata, and I can have a different model for different portions of the generation tasks - making the model-to-text generation simpler. If I was doing that, which technologies would I want to look at inside EMP? A suppose it may also be a practical compromise to use UML (rather than my own model) for the more abstract 'application model' as well as for the specific code generation aspect. I suspect this is sort of the standard approach used for MDA when they talk about the PSM vs PIM, but I don't know enough about MDA to be sure.

2) My application also contains a simple workflow engine, nothing fancy - not BMP/BPEL level stuff, just an engine that creates tasks and dependencies between them. It can easily be specified via a textual document and I was planning to use XML for this, but would love to have a DSL and would be ecstatic to also have a graphical editor to create the DSL. I have come across xtext and it looks like exactly what I need. I see also that it has some sort of capability to interface with GEF. How would I go about learning the required skills to implement this? Does this require I learn all of the EMF core and GEF along with xtext?

So, apologies for the long post, but I would be very grateful for some guidance on how to proceed.

Much thanks.

Nos
Re: Where to start with Eclipse Modelling Projects [message #619739 is a reply to message #619738] Fri, 09 July 2010 14:42 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26279
Registered: July 2009
Senior Member
Nos,

Comments below.

Nos Doughty wrote:
> Hi,
>
> I have a project I am working on and have come to the conclusion that
> the idea of MDA is more practical than I have previously thought.
You forget the (TM) trademark on the term.
> I have been exploring writing some custom code generators using FMPP
> and Ant tasks, and after checking out MDA came across a webcast of
> Acceleo in Helios and am starting to realise that 'doing MDA properly'
> might not be as scary as I thought ;)
It's less scary than reinventing the wheel.
>
> I'm very excited about the all the technology in the Eclipse Modelling
> Project, but am not sure where to start learning from as some of the
> projects seem to complement each other and some have overlapping
> functionalities.
>
> I'll explain briefly what I have in mind, and I would greatly
> appreciate some guidance on:
> 1) Which technologies are suitable for each task, and
> 2) which learning resources should I used for each chosen technology.
Generally the documentation is pretty poor. We're developers and like
to write code. Writing documentation is time consuming and not terribly
rewarding. What you can find on the home pages for the projects is
generally all there is. Google can be a very helpful friend.
>
> There are two aspects where I want to involve modelling in my Project.
>
> 1a) I have a Eclipselink(JPA2) based domain model which needs
> generation. I am using the JEE6 standards but using an architecture
> inspired by Adam Bien's book 'Real World Java EE Patterns' and ECB in
> general, along with a style of code which results in 'fluent'
> interfaces and special annotations which are used to add semantic
> metadata to be consumed as part of unit testing to check compliance of
> the resulting classes to constraints (eg, @Immutable, @Factory) - so a
> standard JEE generator is not what I am after - but might server as a
> useful basis if it can be easily modified.
> Along with this I have a custom built DTO/Presentation layer library
> which compounds the JPA entities into abstract workflows and then some
> factories turn this into concrete screen widgets/events - currently I
> am using Vaadin as a view technology and would like to code generate
> portions of this too.
>
> I'm really after a visual model for this, and am happy to use some
> sort of UML tool to create the model. The complication is that I want
> to model to hold some additional semantics for the domain over and
> above standard JPA information as I want the generator to take into
> account some usage constraints for generating the 'Control' elements
> (such as implementing paging for large collections but not for small,
> and differentiating between owned collections and un-owned ones with
> more than just the 'private ownership' metadata in JPA.
You might want to have a quick look at
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/references/overview/EMF.html
and
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/clibmod/clibmod.html
to get a sense what EMF is capable of. There's a whole book about EMF.
>
> Assuming I can use UML for this, I suppose I would proceed by finding
> a UML tool (like Poseidon) and making my model, exporting it as XMI
> and then using Acceleo to general Java code. I will need to modify the
> JEE generator aspect to produce the output I have in mind.
Yes, that's certainly feasible. One drawback is that while the UML API
is very powerful, it's also very complex, and that complexity will make
your templates more difficult to write and understand. Ecore is simple
and Ecore Tools provides a graphical editor for it; the editor isn't
exactly industrial strength though....
> 1b) If it's not too much work though, I'd be happy with another level
> of abstraction. I'd *love* to be able to create my own visual model of
> an application, then do some sort of model-to-model transformation
> into the UML used to generate the actual java files.
If you have your own model, I think you'll want to omit the "map to UML"
step but rather use it directly, or perhaps map it to Ecore, as we map
XSD, Rose, annotated Java, and UML to Ecore in order to produce a Java
API for them. It's certainly a lot of work to create your own graphical
editor, using GMF, for your model, but you'd have complete control over
what is and isn't there.
> Then the UML model used for the generation would need to contain less
> semantic metadata, and I can have a different model for different
> portions of the generation tasks - making the model-to-text generation
> simpler. If I was doing that, which technologies would I want to look
> at inside EMP? A suppose it may also be a practical compromise to use
> UML (rather than my own model) for the more abstract 'application
> model' as well as for the specific code generation aspect. I suspect
> this is sort of the standard approach used for MDA when they talk
> about the PSM vs PIM, but I don't know enough about MDA to be sure.
I think many of us here at Eclipse are not huge fans of what we see as
heavy weight, water fall, MDA. The term model driven software
development is often used to describe a more agile development
methodology that has models at its core.
> 2) My application also contains a simple workflow engine, nothing
> fancy - not BMP/BPEL level stuff, just an engine that creates tasks
> and dependencies between them. It can easily be specified via a
> textual document and I was planning to use XML for this, but would
> love to have a DSL and would be ecstatic to also have a graphical
> editor to create the DSL.
Or a textual one...
> I have come across xtext and it looks like exactly what I need.
Yes, it's awesome.
> I see also that it has some sort of capability to interface with GEF.
> How would I go about learning the required skills to implement this?
> Does this require I learn all of the EMF core and GEF along with xtext?
You likely will want to look at GMF. There's a GMF book as well. Also,
there's the new Graphiti project coming on line with the aim to be
simpler than GMF and to hide GEF, so that might be interesting.
>
> So, apologies for the long post, but I would be very grateful for some
> guidance on how to proceed.
No doubt you'll get significant value from investing some time learning
the technologies available at Eclipse. It's likely to be a bit
frustrating, but you'll find most teams are very responsive to questions
on the newsgroups.
> Much thanks.
>
> Nos
>
Previous Topic:BPMN2
Next Topic:Where to start with Eclipse Modelling Projects
Goto Forum:
  


Current Time: Thu Dec 18 11:35:57 GMT 2014

Powered by FUDForum. Page generated in 0.09439 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software