Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » Xpand and Xtend2/Xtext
Xpand and Xtend2/Xtext [message #798256] Tue, 14 February 2012 07:47 Go to next message
Eclipse UserFriend
Hi!

I have created a custom metamodel for Xpand the last few months. And have recently realized that the template expression stuff in Xtend is the "new" Xpand. I have a few questions regarding this.

How does the old "components" in Xpand fit into Xtend2? Does it fit at all?
I use a metamodel which ofcourse inherits the MetaModel, along with custom types which is used within the metamodel.
From the little I have seen, it seems that you work directly on the java objects, which means that you wont be able to create custom methods and types for your metamodel.

Is it at all possible to migrate the old solution to Xtend2? Is it worth it?
Is the development of Xpand stopped in favour of Xtend2?

Questions I asked earlier about developing the metamodel etc.:
http://www.eclipse.org/forums/index.php/m/740250/#msg_740250
http://www.eclipse.org/forums/index.php/m/757511/#msg_757511
Re: Xpand and Xtend2/Xtext [message #798277 is a reply to message #798256] Tue, 14 February 2012 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
How does the old "components" in Xpand fit into Xtend2? Does it fit at all?

If you mean the Generator workflow component, there is a similar one in Xtext, which assumes that you have an Xtend class configured in the guice config that implements IGenerator. For Xtext based models this works quite out-of-the-box, and an appropriate workflow is generated for you. For other workflows you will have to provide a Guice Runtime Module and an implementation of ISetup to use this component. Or you write your own one deriving from AbstractWorkflowComponent2.
Quote:
Is it at all possible to migrate the old solution to Xtend2?

Possible, of course. Automatic - no. This is a migration project. But you could translate Xpand to Xtend Rich Strings and Xtend1 functions to Xtend2 methods quite straight forward.
Quote:
Is the development of Xpand stopped in favour of Xtend2?

More or less. Xpand will be maintained for some time, but development effort is put into Xtend2.
Quote:
Is it worth it?

Yes. The tooling for Xtend is now already much better than for Xpand. Further, Xtend2 compiles to Java. The resulting code has just minimal runtime dependencies and is hell fast. Xpand is an interpreted approach and naturally slower. However, code generation performance is usually not a direct problem until reaching large scale models or generators.
There are also some gaps that Xtend has against Xpand and probably does not close in mid-term. One prominent example are the extensible type systems, especially the UML typesystem. When working with profiled UML models Xpand is definetely the best approach so far.

Kind regards,
~Karsten
Re: Xpand and Xtend2/Xtext [message #798492 is a reply to message #798277] Tue, 14 February 2012 14:05 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for a great answer!

Karsten Thoms wrote on Tue, 14 February 2012 08:28

There are also some gaps that Xtend has against Xpand and probably does not close in mid-term. One prominent example are the extensible type systems, especially the UML typesystem. When working with profiled UML models Xpand is definetely the best approach so far.


As I stated in my first post, I have a custom metamodel(perhaps called metameta-model in the documentation) for Xpand, ie. my own mapping of types to Xpand. With this I have an environment for creating templates for a custom modeling language.
What you are saying is that this is not possible in Xtend2? If so, will this become possible in the future?


Re: Xpand and Xtend2/Xtext [message #798494 is a reply to message #798492] Tue, 14 February 2012 14:08 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

i guess it will not be possible. but depending on what you are actually doing in your custom metamodel it might work anyway.

~Christian
Re: Xpand and Xtend2/Xtext [message #799051 is a reply to message #798494] Wed, 15 February 2012 06:33 Go to previous message
Eclipse UserFriend
In essence I do the same as say EMFRegistryMetaModel... I map my types to custom Xpand types.

It seems to me that when using template expressions in xtend, this isnt backed by any metamodel, and works directly on any available java objects instead of types derived from the metamodel?
Also it seems like this approach blurs the line between template code and logic; isnt that a bad thing?


Previous Topic:Problems with Xpand
Next Topic:Exception generation
Goto Forum:
  


Current Time: Mon Jul 07 08:27:35 EDT 2025

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

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

Back to the top