Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Migrating from Oaw Xtext to TMF Xtext
Migrating from Oaw Xtext to TMF Xtext [message #43122] Wed, 06 May 2009 12:58 Go to next message
Eclipse UserFriend
Hi all,

We have open sourced Mod4j (mod4j.org) last April 1st. We have been very
busy with this, and are now looking into the Galileo release and specifically
into the new TMF Xtext, but also the Eclipse Xpand/Xtend/Checks and the
MWE components.

I have read through the TMF reference and can see that there are many
improvements being made making TMF more flexible then Oaw Xtext.
To see whether we should migrate to TMF and what work is involved I have
compiled a list of issues that are of importance to us.

The following issues seem to be simple.

1. We use an existing Ecore meta model, which seems to be ok, this is
neatly supported by TMF.
2. All grammar constructs from Oaw Xtext are supported by TMF Xtext,
modulo a few syntactic changes (like “import” instead of “preventMMGeneratrion”)
3. An Eclipse editor is generated
4. Xtend, Xpand and Checks are basically the same in Oaw, so I don’t
expect any problems there (Am I right?)

The next issues seem to be more work and I have some questions that
I hope someone might be able to answer:
1. We use (slightly adapted versions) of the generated New DSl Project and New Dsl File
wizards that were generated by Oaw Xtext, I don’t see any of these wizards being
generated by TMF Xtext. As these wizards are important to lower the barrier for our
users it would be a loss if they were not generated anymore. We can of course write
our own wizards from scratch, but that is more work, which we need to plan. Do you
plan to add the wizard generation to TMF Xtext ?
2. The MWE syntax seems to be different from the Oaw modeling workflow syntax (at least
I see “fragment” instead of “component” and many path names are at least different.
How big is the difference ? I have tried the documentation and FAQ links in the MWE wiki,
but end up in an empty page. Are the changes described anywhere?
3. We have integrated the running of workflows into the Eclipse builder. For this we start
the workflow engine programmatically from Java. I see no documentation on how this should
be done with MWE. This is a crucial issue for us, because the workflow must be run within
the same JVM as Eclipse, because that is where the CrossX broker is running.
4. We have mavenized running the workflow as well as integrated it into Eclipse. Do you
(plan to) provide any support for the use of maven to run workflows?
5. We have not been able to run the Xtext generator from Maven, will this become possible in TMF Xtext ?
6. The Oaw Xtext generator cleans the src-gen directory. It also clean all of the SVN information
there which confuses SVN. Of course we should not have to put the src-gen into SVN, but we have to
because of the previous issue (running Xtext generator from maven). Is this something that you
plan to resolve?
7. Writing your own code completion proposals was done through Xtend functions in Oaw Xtext. In
the documentation (and the example project I did) of TMF Xtext I see only the possibility to do
this through Java, in a way that looks quite different at first sight. As we have invested a lot
of effort to provide customized code completion this seems a lot of work for us. Are there
plans to also support the use of Xtend functions for proposals? Apart from the fact that this \
would be handy for us, using Xtend also makes it much easier and much less work to write you
own proposals.
In the feature map of TMF Xtext versus Oaw Xtext there is an X with the issue
“Xtend API for Code Completion”, but I can’t find it documentend anywhere.

Greeting, Jos
Re: Migrating from Oaw Xtext to TMF Xtext [message #43156 is a reply to message #43122] Wed, 06 May 2009 14:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jos,

Jos Warmer schrieb:
> The following issues seem to be simple.
>
> 1. We use an existing Ecore meta model, which seems to be ok, this is
> neatly supported by TMF.
> 2. All grammar constructs from Oaw Xtext are supported by TMF Xtext,
> modulo a few syntactic changes (like “import” instead of “preventMMGeneratrion”)
> 3. An Eclipse editor is generated
> 4. Xtend, Xpand and Checks are basically the same in Oaw, so I don’t
> expect any problems there (Am I right?)

Yes, the languages havn't changed.

>
> The next issues seem to be more work and I have some questions that
> I hope someone might be able to answer:
> 1. We use (slightly adapted versions) of the generated New DSl Project and New Dsl File
> wizards that were generated by Oaw Xtext, I don’t see any of these wizards being
> generated by TMF Xtext. As these wizards are important to lower the barrier for our
> users it would be a loss if they were not generated anymore. We can of course write
> our own wizards from scratch, but that is more work, which we need to plan. Do you
> plan to add the wizard generation to TMF Xtext ?

Yes, we already have some rough prototypes and think we can improve
them. I'm not sure if they will be included in every Xtext DSL by
default in the final release, but the corresponding generator fragments
(TMF Xtext's generator is composable using so called fragments) will be
shipped so one can easily add this to the workflow.
Anyway, you could also easily create (and contribute) your own fragments
(shouldn't be too much work in the case of wizards), in case the thinks
we do in the area don't meet your expectations.


> 2. The MWE syntax seems to be different from the Oaw modeling workflow syntax (at least
> I see “fragment” instead of “component” and many path names are at least different.
> How big is the difference ? I have tried the documentation and FAQ links in the MWE wiki,
> but end up in an empty page. Are the changes described anywhere?

The language has not been changed. The fragments are not language
concepts but library concepts : The Xtext generator component is
configured with instances of IGeneratorFragment, which are injected into
XtextGenerator.addFragment(IGeneratorFragment) (hence the <fragment />
elements.

> 3. We have integrated the running of workflows into the Eclipse builder. For this we start
> the workflow engine programmatically from Java. I see no documentation on how this should
> be done with MWE. This is a crucial issue for us, because the workflow must be run within
> the same JVM as Eclipse, because that is where the CrossX broker is running.

One of the few things we changed in MWE is making the Java API to invoke
workflows more convenient.
With MWE you'll have to write something like this:

new WorkflowFacade("my/path/to/Workflow.mwe").run();

> 4. We have mavenized running the workflow as well as integrated it into Eclipse. Do you
> (plan to) provide any support for the use of maven to run workflows?

We've just checked in pom.xml for the various bundles and plan to make
them available somewhere (maybe ibiblio ?).
AFAIK the workflow plugin for m2 from fornax has not yet been migrated
to MWE.

> 5. We have not been able to run the Xtext generator from Maven, will this become possible in TMF Xtext ?

Yes, we already tried that. Works without changing the workflows. :-)

> 6. The Oaw Xtext generator cleans the src-gen directory. It also clean all of the SVN information
> there which confuses SVN. Of course we should not have to put the src-gen into SVN, but we have to
> because of the previous issue (running Xtext generator from maven). Is this something that you
> plan to resolve?

We've fixed the DirectoryCleaner in M2T. So that SVN files won't be deleted.
Also you can decide whether and how you want to delete the source-gen
folder as it is not included in the generator workflow shipped with TMF
Xtext. However, the project wizard creates an MWE file which uses the
directory cleaner.

> 7. Writing your own code completion proposals was done through Xtend functions in Oaw Xtext. In
> the documentation (and the example project I did) of TMF Xtext I see only the possibility to do
> this through Java, in a way that looks quite different at first sight. As we have invested a lot
> of effort to provide customized code completion this seems a lot of work for us. Are there
> plans to also support the use of Xtend functions for proposals? Apart from the fact that this \
> would be handy for us, using Xtend also makes it much easier and much less work to write you
> own proposals.
> In the feature map of TMF Xtext versus Oaw Xtext there is an X with the issue
> “Xtend API for Code Completion”, but I can’t find it documentend anywhere.

We strongly recommend to use the Java-based APIs. They are equally
convenient but much more flexible and debuggable. Also Java-based
implementations are factors faster then Xtend based implementations.
Performance is especially critical for the linking and scoping as well
as validation. OAW Xtext editors don't scale because these things have
usually been implemented in Xtend.

That said, we have Xtend-based APIs (not documented yet), which are
similar to the ones from oAW Xtext but not directly compatible.

The same applies for all other aspects: We have convenient, flexible,
scalable Java-Based interfaces and provide similar Xtend-based APIs in
addition. We expect that people will see the advantages in the Java APIs
(at least we do, although as you know I have a strong relationship with
Xtend).

Cheers,
Sven
Re: Migrating from Oaw Xtext to TMF Xtext [message #43172 is a reply to message #43156] Thu, 07 May 2009 05:21 Go to previous messageGo to next message
Eclipse UserFriend
Sven Efftinge bracht volgend idée uit :
> Hi Jos,
>
> Jos Warmer schrieb:
>
<... removed stuff...>

>> 2. The MWE syntax seems to be different from the Oaw modeling workflow
>> syntax (at least
>> I see “fragment” instead of “component” and many path names are at least
>> different.
>> How big is the difference ? I have tried the documentation and FAQ
>> links in the MWE wiki,
>> but end up in an empty page. Are the changes described anywhere?
>
> The language has not been changed. The fragments are not language concepts
> but library concepts : The Xtext generator component is configured with
> instances of IGeneratorFragment, which are injected into
> XtextGenerator.addFragment(IGeneratorFragment) (hence the <fragment />
> elements.

Ok, but to udnerrstand and use the MWE, I need tio udnersatdn the
library concepts. Is there any documentation available on this?
>

<... removed stuff...>

>
>> 5. We have not been able to run the Xtext generator from Maven, will this
>> become possible in TMF Xtext ?
>
> Yes, we already tried that. Works without changing the workflows. :-)
>
Great ! Can you point to an example of how to do this ?

>> 6. The Oaw Xtext generator cleans the src-gen directory. It also clean all
>> of the SVN information
>> there which confuses SVN. Of course we should not have to put the
>> src-gen into SVN, but we have to
>> because of the previous issue (running Xtext generator from maven). Is
>> this something that you
>> plan to resolve?
>
> We've fixed the DirectoryCleaner in M2T. So that SVN files won't be deleted.
> Also you can decide whether and how you want to delete the source-gen folder
> as it is not included in the generator workflow shipped with TMF Xtext.
> However, the project wizard creates an MWE file which uses the directory
> cleaner.
>
Good, we just need to change the MWE file and the problem is solved.

>> 7. Writing your own code completion proposals was done through Xtend
>> functions in Oaw Xtext. In
>> the documentation (and the example project I did) of TMF Xtext I see
>> only the possibility to do
>> this through Java, in a way that looks quite different at first sight.
>> As we have invested a lot
>> of effort to provide customized code completion this seems a lot of work
>> for us. Are there
>> plans to also support the use of Xtend functions for proposals? Apart
>> from the fact that this \
>> would be handy for us, using Xtend also makes it much easier and much
>> less work to write you
>> own proposals.
>> In the feature map of TMF Xtext versus Oaw Xtext there is an X with the
>> issue
>> “Xtend API for Code Completion”, but I can’t find it documentend
>> anywhere.
>
> We strongly recommend to use the Java-based APIs. They are equally convenient
> but much more flexible and debuggable. Also Java-based implementations are
> factors faster then Xtend based implementations.
> Performance is especially critical for the linking and scoping as well as
> validation. OAW Xtext editors don't scale because these things have usually
> been implemented in Xtend.
>
> That said, we have Xtend-based APIs (not documented yet), which are similar
> to the ones from oAW Xtext but not directly compatible.
>
> The same applies for all other aspects: We have convenient, flexible,
> scalable Java-Based interfaces and provide similar Xtend-based APIs in
> addition. We expect that people will see the advantages in the Java APIs (at
> least we do, although as you know I have a strong relationship with Xtend).
>
I see the point that Java is faster. However that is not really a
languagee feature, but more an impklementation fature. As far as I can
telle it is possible to translate Xtend expression to Java and compile
these, giving you the same speed as a native Java method ... and the
convenience to use the much more expressive Xtend language to write you
navigations throughb the model :-).

> Cheers,
> Sven

Jos
Re: Migrating from Oaw Xtext to TMF Xtext [message #43301 is a reply to message #43172] Thu, 07 May 2009 11:48 Go to previous messageGo to next message
Eclipse UserFriend
Hey Jos,

>>> 5. We have not been able to run the Xtext generator from Maven, will
>>> this become possible in TMF Xtext ?
>>
>> Yes, we already tried that. Works without changing the workflows. :-)
>>
> Great ! Can you point to an example of how to do this ?


Karsten Thoms and me have prepared a working maven build with TMF Xtext
in our current project. Karsten will polish this solution and blog about
that. I'll keep you informed about this.

Briefly: Grammar, generator and model project are three discrete maven
artifacts. Use the plugin org.codehaus.mojo/build-helper-maven-plugin to
include the additional src-gen folder. The plugin
org.fornax.toolsupport/fornax-oaw-m2-plugin is finally able to run a
given workflow.
You can find applicable maven repositories at
http://www.fornax-platform.org/m2/repository
http://www.openarchitectureware.org/m2-snapshot
http://www.openarchitectureware.org/m2

At the moment you have to derive the needed depdencies of Xtext by hand,
but this will be more convenient in the near future.

Regards,
Heiko
Re: Migrating from Oaw Xtext to TMF Xtext [message #43449 is a reply to message #43122] Thu, 07 May 2009 20:02 Go to previous messageGo to next message
Eclipse UserFriend
> 1. We use an existing Ecore meta model, which seems to be ok, this is
> neatly supported by TMF.

The problem is that you'll be able to get the xtext editor working as long
as you import the generated Epackage or Ecore for the existing metamodel
by configuring the workflow file (search this list or see also the MWE
section in Rich Gronback's excellent GMF/modelling book), but you may find
it very difficult to get an xPand template or xtend template to work in
conjunction with it to create a compiler. Haven't tried an interpreter in
this situation.

In other words :
- Xpand/xtend will generally work in conjunction with Xtext if you only
use Xtext metamodel inference.
- Xpand/xtend won't or may not work properly if your Xtext model includes
metamodel inference and an imported Ecore/EMF model. They won't or may not
detect the metamodels even if you get the xtext part working and even if
you copy all the ecore models to the xpand folder.

See these bugs/patches:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=269635
https://bugs.eclipse.org/bugs/show_bug.cgi?id=269596

I've been trying to get these patches to work but without success so far.

If anyone has had any success in getting a complete tool chain working
consisting of:
- Import EMF/Ecore model in xtext, combined with
- metalmodel inference in Xtext, then
- Xpand and xtend models referencing the xtext model.
then I'd be happy to hear how you did it.

You can try using the default xtext project and importing any simple ecore
metamodel to check this.
Re: Migrating from Oaw Xtext to TMF Xtext [message #43542 is a reply to message #43449] Fri, 08 May 2009 02:47 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Porter schrieb:
>
>
>> 1. We use an existing Ecore meta model, which seems to be ok, this is
>> neatly supported by TMF.
>
> The problem is that you'll be able to get the xtext editor working as
> long as you import the generated Epackage or Ecore for the existing
> metamodel by configuring the workflow file (search this list or see also
> the MWE section in Rich Gronback's excellent GMF/modelling book), but
> you may find it very difficult to get an xPand template or xtend
> template to work in conjunction with it to create a compiler. Haven't
> tried an interpreter in this situation.

Why is that difficult?

>
> In other words :
> - Xpand/xtend will generally work in conjunction with Xtext if you only
> use Xtext metamodel inference.
> - Xpand/xtend won't or may not work properly if your Xtext model
> includes metamodel inference and an imported Ecore/EMF model. They won't
> or may not detect the metamodels even if you get the xtext part working
> and even if you copy all the ecore models to the xpand folder.

I'm not aware of such problems...

>
> See these bugs/patches:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=269635
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=269596

These bugs are not directly related.
Anyway, I've fixed/closed them.

> If anyone has had any success in getting a complete tool chain working
> consisting of:
> - Import EMF/Ecore model in xtext, combined with
> - metalmodel inference in Xtext, then
> - Xpand and xtend models referencing the xtext model.
> then I'd be happy to hear how you did it.

I did. :-)
As this is a thing often asked for, I'll try to come up with a short
description of how to do this within the next weeks.

Regards,
Sven
Re: Migrating from Oaw Xtext to TMF Xtext [message #44374 is a reply to message #43172] Tue, 19 May 2009 03:09 Go to previous message
Eclipse UserFriend
Jos Warmer schrieb:
>>> 5. We have not been able to run the Xtext generator from Maven, will
>>> this become possible in TMF Xtext ?
>>
>> Yes, we already tried that. Works without changing the workflows. :-)
>>
> Great ! Can you point to an example of how to do this ?
>

Karsten has blogged about it :
http://kthoms.wordpress.com/2009/05/19/fornax-oaw-plugin-ver sion-3-0-0-released/

There's also an example.

Cheers,
Sven
Previous Topic:TextEditor in TextArea
Next Topic:[XText] Possibility to read the order of a node
Goto Forum:
  


Current Time: Thu Jul 10 00:21:13 EDT 2025

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

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

Back to the top