Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » [QVTo] Transform a unique element of the model(I need to conserve all the model structure but transform one element only.)
[QVTo] Transform a unique element of the model [message #1702740] Fri, 24 July 2015 12:12 Go to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Hi,

I need to conserve all the model structure but transform one element only.

What is the best way to make that?

Regards.
Re: [QVTo] Transform a unique element of the model [message #1702751 is a reply to message #1702740] Fri, 24 July 2015 13:07 Go to previous messageGo to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 167
Registered: August 2013
Senior Member
Hi

I'm not sure about QVTo, but ATL supports in-place transformations.

It would be interest to know whether QVTo supports them.
Re: [QVTo] Transform a unique element of the model [message #1702762 is a reply to message #1702751] Fri, 24 July 2015 13:30 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Hi,

Yes, QVTo supports inplace transformations.

Regards.
Re: [QVTo] Transform a unique element of the model [message #1702779 is a reply to message #1702762] Fri, 24 July 2015 14:24 Go to previous messageGo to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 167
Registered: August 2013
Senior Member
As far as I understand you need in-place transformation? This transformation copies (conserves) all the model structure and allows you to change some elements.
Re: [QVTo] Transform a unique element of the model [message #1702781 is a reply to message #1702779] Fri, 24 July 2015 14:27 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Hi

Yes, i need that. What is the best way to make that?

Regards,.
Re: [QVTo] Transform a unique element of the model [message #1702822 is a reply to message #1702781] Sat, 25 July 2015 09:41 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5393
Registered: July 2009
Senior Member
Hi

I've not used it myself, but I think you just declare the model as
"inout". Compare to the conventional "in" and "out" for a manually coded
copy/regeneration.

Regards

Ed Willink


On 24/07/2015 15:27, Gonzalo Bressan Zuber wrote:
> Hi
>
> Yes, i need that. What is the best way to make that?
>
> Regards,.
Re: [QVTo] Transform a unique element of the model [message #1702928 is a reply to message #1702822] Mon, 27 July 2015 12:10 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Hi Ed,

Can i copy all the model structure modifying only one property without in-place transformation?

I need transform just an operator on a java model with mutation testing ends.

Regards
Re: [QVTo] Transform a unique element of the model [message #1702940 is a reply to message #1702928] Mon, 27 July 2015 13:04 Go to previous messageGo to next message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
There is a pattern to copy all the model structure?

Regards.
Re: [QVTo] Transform a unique element of the model [message #1702947 is a reply to message #1702928] Mon, 27 July 2015 14:12 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5393
Registered: July 2009
Senior Member
Hi

Yes. But you have to code the copy yourself; really tedious unless you
use an auto-generator. You could wrap a call to EcoreUtil.Copier.

Provision of a more automated copy is a WIBNIF for all three QVT languages.

Regards

Ed Willink



On 27/07/2015 13:10, Gonzalo Bressan Zuber wrote:
> Hi Ed,
> Can i copy all the model structure modifying only one property without
> in-place transformation?
>
> I need transform just an operator on a java model with mutation
> testing ends.
>
> Regards
Re: [QVTo] Transform a unique element of the model [message #1703302 is a reply to message #1702947] Thu, 30 July 2015 12:22 Go to previous messageGo to next message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 57
Registered: April 2011
Member
Ed Willink wrote on Mon, 27 July 2015 10:12
But you have to code the copy yourself; really tedious unless you use an auto-generator.

The generator approach works pretty well. It allows to code selective changes, without specifying the schematic repetitive traversal code. A successful application of the approach has already been reported by Alexander Kraas: http://ceur-ws.org/Vol-1285/paper06.pdf
Re: [QVTo] Transform a unique element of the model [message #1703314 is a reply to message #1703302] Thu, 30 July 2015 14:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5393
Registered: July 2009
Senior Member
Hi

Unfortunately that paper only does half the work. There is no
extensibility through a shared/disjuncted hierarchy of copies.

A little more work synthesizing these can make the approach much more
re-useable and extensible.

Regards

Ed Willink


On 30/07/2015 13:22, Christopher Gerking wrote:
> Ed Willink wrote on Mon, 27 July 2015 10:12
>> But you have to code the copy yourself; really tedious unless you use
>> an auto-generator.
>
> The generator approach works pretty well. It allows to code selective
> changes, without specifying the schematic repetitive traversal code. A
> successful application of the approach has already been reported by
> Alexander Kraas: http://ceur-ws.org/Vol-1285/paper06.pdf
Re: [QVTo] Transform a unique element of the model [message #1703573 is a reply to message #1703314] Mon, 03 August 2015 09:44 Go to previous messageGo to next message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 57
Registered: April 2011
Member
Ed Willink wrote on Thu, 30 July 2015 10:22
There is no extensibility through a shared/disjuncted hierarchy of copies.
Sorry, can't follow you here. What hierarchy of copies?
Re: [QVTo] Transform a unique element of the model [message #1703579 is a reply to message #1703573] Mon, 03 August 2015 10:29 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5393
Registered: July 2009
Senior Member
Hi

Each class should contribute a copy method for its own attributes so
that there is a hierarchy of copy methods that derived classes can join
together as appropriate in the autogenerated framework.

The tailoring application can then just override those parts that are
necessary.

For example. Suppose my tailoring transformation wants to enforce upper
case names, I want to do that once in the abstract copy for the name
feature, not in every derived class that re-implements the name copy.

Regards

Ed Willink



On 03/08/2015 10:44, Christopher Gerking wrote:
> Ed Willink wrote on Thu, 30 July 2015 10:22
>> There is no extensibility through a shared/disjuncted hierarchy of
>> copies.
> Sorry, can't follow you here. What hierarchy of copies?
>
Re: [QVTo] Transform a unique element of the model [message #1703739 is a reply to message #1703579] Tue, 04 August 2015 14:36 Go to previous messageGo to next message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 57
Registered: April 2011
Member
Hi

Yes, we solved this problem by generating an abstract 'doCopy' mapping per abstract base class, which copies only the class attributes. This mapping is then inherited by all subclass mappings:

mapping EClassifier :: copyEClassifier() : EClassifier
   disjuncts EClass::copyEClass, EDataType::copyEDataType;

mapping EClass :: copyEClass() : EClass 
   inherits EClassifier::doCopyEClassifier {

      eStructuralFeatures := self.eStructuralFeatures.map copyEStructuralFeature();
      ...
}

mapping EDataType :: copyEDataType() : EDataType
   inherits EClassifier::doCopyEClassifier {

      serializable := self.serializable;
}

abstract mapping EClassifier :: doCopyEClassifier() : EClassifier 
   inherits ENamedElement::doCopyENamedElement {

      eTypeParameters := self.eTypeParameters.map copyETypeParameter();
      ...
}

abstract mapping ENamedElement :: doCopyENamedElement() : ENamedElement {
   name := self.name;
}


What I would like to do is using disjuncts/inherits together:

mapping EClassifier :: copyEClassifier() : EClassifier
   inherits EClassifier::doCopyEClassifier
   disjuncts EClass::copyEClass, EDataType::copyEDataType;
But that's not supported by Eclipse QVTo.

[Updated on: Wed, 05 August 2015 08:38]

Report message to a moderator

Re: [QVTo] Transform a unique element of the model [message #1704001 is a reply to message #1702740] Thu, 06 August 2015 14:38 Go to previous message
Gonzalo Bressan Zuber is currently offline Gonzalo Bressan ZuberFriend
Messages: 35
Registered: May 2015
Member
Hi,

To clarify my problem, still unresolved.....

the following is my java program. I need replace the PLUS sign by a MINUS sign.

-------------------------------
package tesis;

public class clase1 {
private int metodo () {
int op1 = 8;
int op2 = 2;
int suma= op1+op2;
return suma;
}
}
-----------------------------------
I attach the file of the resultant model from the MoDisco discoverer.

http://fotos.subefotos.com/b445c5b78de9a48134d82825c5752faeo.png

Regards.
Previous Topic:[QVTo] Mapping that needs to modify initial Model
Next Topic:Javadocs
Goto Forum:
  


Current Time: Thu Sep 21 01:42:41 GMT 2017

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

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