|Re: [ATL] How to?The enhaced Family2Person case [java objects transformation] [message #48581 is a reply to message #48325]
||Mon, 25 June 2007 08:25
| Frédéric Jouault
Registered: July 2009
ATL is a QVT-like model-to-model transformation language.
This means that your source and target have to be models.
Usually, these models are handled using either EMF or MDR, for which ATL
Here are several possible approaches to solve your problem, the way I
- If your Family and Member classes are (or can be) generated by EMF,
then ATL will be able to handle Family and Member objects using the EMF
- You may serialize your Java objects in a format suitable for EMF usage
(e.g., XMI), transform them with ATL, then deserialize them.
- You may serialize your Java objects to a an XML format (e.g., with
something like http://xstream.codehaus.org/, or http://jsx.org/), and
then inject them into a model (see:
- It should be possible to directly handle arbitrary Java objects.
However, because they are not handled by either EMF or MDR, you will
need a specific driver for this, which will make them appear as models.
Stephen Yu wrote:
> I have a case like the Family2Person sample, but the input and out are
> java objects, I still do not find the right solution.
> The task is to tranform some Family java objects to several Person java
> objects. So this transformation is programmatically done.
> for example, firstly, some Family and Member java objcts are created
> like followings:
> Family f1 = new Family();
> Member m1 = new Member();
> after the transformation, the output should be a list of Person objects.
> Can this task be done through ATL? Maybe this task can divided into some
> sub-tasks, some of them can be doen through ATL. These days I'm totally
> confused by this task. :(
> Would you give me some suggestion or ideas?
> Thanks a lot.
Powered by FUDForum
. Page generated in 0.29437 seconds