Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] How to?The enhaced Family2Person case [java objects transformation]
[ATL] How to?The enhaced Family2Person case [java objects transformation] [message #48325] Fri, 22 June 2007 07:03 Go to next message
stephen Yu is currently offline stephen YuFriend
Messages: 35
Registered: July 2009
Member
Hi,

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.
Re: [ATL] How to?The enhaced Family2Person case [java objects transformation] [message #48495 is a reply to message #48325] Mon, 25 June 2007 05:38 Go to previous messageGo to next message
stephen Yu is currently offline stephen YuFriend
Messages: 35
Registered: July 2009
Member
I did hard code mapping between these two java objects before I know ATL.
In fact, this is some kind of model transformation, so I try to use ATL,
but I meet lots of problems. :(

If you have some idea, please let me know.
Thanks a lot


Stephen.
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 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

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
has drivers.


Here are several possible approaches to solve your problem, the way I
understand it:

- 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
driver.

- 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:
http://wiki.eclipse.org/index.php/ATL_Howtos#How_can_I_handl e_arbitrary_XML_documents.3F).

- 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.


Regards,

Frédéric Jouault


Stephen Yu wrote:
> Hi,
>
> 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.
>
Previous Topic:[ATL] non deterministic behaivor
Next Topic:[ATL]should the passed in name be same with the package name in KM3?
Goto Forum:
  


Current Time: Tue Apr 23 09:37:52 GMT 2024

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

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

Back to the top