Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [m2m-dev] Do inout mappings instantiate a trace instance?

Hi Marcel,

Congratulations! You have hit a bug
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=266854). Thanks very much
for your investigation!
Your assumption is almost correct. Trace records were created only if
mapping declared some result. Such behaviour is wrong since trace
records must be created regardless of the result declaration. The next
I-build will contain the fixed version.

As for now, I would suggest to modify the mapping like this:

mapping inout Package::copyFields() : Package
{
	init {
		var classA:Class := self.getClassForName('A');
		var classB:Class := self.getClassForName('B');
		
		map copyFields(classA, classB);
		result := self;
	}
}

If so the invresolveIn(Package::copyFields, Package) expression would
return all the Package objects involved in the mapping. Please note that
invresolveIn(copyFields, Package) refers to a contextless mapping which
is also present in your script. Since then, it won't return anything.

WBR,
Alex.

P.S. One other thing, the best place for messages like this is the M2M
newsgroup :-)


-----Original Message-----
From: m2m-dev-bounces@xxxxxxxxxxx [mailto:m2m-dev-bounces@xxxxxxxxxxx]
On Behalf Of Marcel Becker
Sent: Monday, March 02, 2009 4:23 PM
To: M2M dev list
Subject: [m2m-dev] Do inout mappings instantiate a trace instance?

Hi,

it seems to me that trace instances are only created when object
creation takes place in a mapping.

So it is not possibly to refer to a inout parameter of a mapping like
this:

mapping inout Package::copyFields()
{
	init {
		var classA:Class := self.getClassForName('A');
		var classB:Class := self.getClassForName('B');
		
		map copyFields(classA, classB);
		
	}
}


And what is about a mapping like this:

mapping copyFields(in sourceClass: Class, inout targetClass: Class) {
	init {
		targetClass.members += sourceClass.members[Field]->
		map copyField(sourceClass);
	}
}

I expected invresolveIn(copyFields, Package) to return a set of Package
objects that a involved in the mapping.

If I'm right with my assumption, that resolving trace models only works
for mappings which create new instances, my question is:

Is there any hint in the QVT standard that suggests this behavior or is
it a decision that is implementation specific?

Thanks,

Marcel
_______________________________________________
m2m-dev mailing list
m2m-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2m-dev



Back to the top