Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Ideas for higher-order in QVTo
Ideas for higher-order in QVTo [message #1069700] Tue, 16 July 2013 12:23 Go to next message
Emilio Salazar is currently offline Emilio SalazarFriend
Messages: 9
Registered: October 2009
Junior Member
Hello all,

Firstly, thank you in advance for your help. And secondly, I am aware that what i am asking could sound a kind of weird...

I have a transformation where I need to execute a set of actions on a model.

There would be different kinds of actions, each one with a known interface that I would provide. But the user would be in charge of implement it.

Moreover, the user could provide zero, one or more actions to run in this step. Therefore, I would need to have a sort of "list of actions".

Another issue is that these actions would deal with models (adding, removing or merging information from different input models into the model i am processing), so it would be great if these actions could be implemented in QVTo as well.

To sum up, I was wondering if exists in QVTo something like Java interfaces or higher-order functions in other languages.

Is this possible in QVTo?

Thank you again.

Regards,
Emilio.

[Updated on: Tue, 16 July 2013 12:27]

Report message to a moderator

Re: Ideas for higher-order in QVTo [message #1070590 is a reply to message #1069700] Thu, 18 July 2013 09:16 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4155
Registered: July 2009
Senior Member
Hi

I think you have two options.

I use MWE to sequence transformations some of which are QVTo. An MWE
script is just an XML file with a nice DSL editor, so you use QVTo could
auto-generate the MWE script and so overcome it's very limited
expression capabilities.

You could arrange for each of your actions to be a QVTo query, so that
an outer QVTo program sequences nested actions. It may already be
possible to this with blackbox transformations. Perhaps someone who
understand blackboes better thyan me can comment.

Regards

Ed Willink


On 16/07/2013 13:23, Emilio Salazar wrote:
> Hello all,
>
> Firstly, thank you in advance for your help. And secondly, I am aware
> that what i am asking could sound a kind of weird...
>
> I have a transformation where I need to execute a set of actions on a
> model.
>
> There would be different kinds of actions, each one with a known
> interface that I would provide. But the user would be in charge of
> implement it.
> Moreover, the user could provide zero, one or more actions to run in
> this step. Therefore, I would need to have a sort of "list of actions".
>
> Another issue is that this actions would deal with models (adding,
> removing or merging information from different input models into the
> model i am processing), so it would be great if these actions could be
> implemented in QVTo as well.
>
> To sum up, I was wondering if exists in QVTo something like Java
> interfaces or higher-order functions in other languages.
>
> Is this possible in QVTo?
>
> Thank you again.
>
> Regards,
> Emilio.
Re: Ideas for higher-order in QVTo [message #1071063 is a reply to message #1070590] Fri, 19 July 2013 09:17 Go to previous messageGo to next message
Emilio Salazar is currently offline Emilio SalazarFriend
Messages: 9
Registered: October 2009
Junior Member
Hi,

I will go with your second option (i.e. each of your actions to be a QVTo query, so that an outer QVTo program sequences nested actions). It allows me to keep using QVTo and avoid other languages, which was my main concern.

Thank you for your fast answer and your help!

Regards,
Emilio.
Re: Ideas for higher-order in QVTo [message #1071679 is a reply to message #1071063] Sat, 20 July 2013 21:50 Go to previous message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 41
Registered: April 2011
Member
Hi

I suggest QVTo's support for "accessing" sub-transformations from a main transformation as an elegant solution.

First, for your actions, define a certain QVTo transformation that acts as your interface. For this purpose, declare the interface in terms of specific mappings/queries/helpers. Just leave out the implementations here.

Second, let users create concrete extensions of this tranformation using the "extends" keyword, overriding all declared operations from above.

Third, create a main transformation that accesses all extensions using the "access" keyword. Create instances of all extensions using "new", and run the instances by calling transform() on each.

Note that by using MWE or Java to specify your main workflow, you lose the traceability in terms of "resolve" support.
Previous Topic:Object type issues
Next Topic:Problem with Stereotype application
Goto Forum:
  


Current Time: Fri Nov 28 17:15:50 GMT 2014

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

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