Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [qvtd-dev] [Dev] QVTi UML2RDBMS faults

Hi Horacio

With the current AST, the interpreted evaluator must do run-time checks. An enhanced AST could annotate those that involve no type filtering and so avoid the redundant run-time check on perhaps 75% of bindings.

The code generator should eliminate the redundant checks. At the moment it does this using EClass testing. I'm still considering whether it can be accelerated further.

---

Two collection bindings in the same call should not lead to duplicates, since while two points in the iteration space may involve the same set of objects, the the set of bindings should be different in each case.

You need to provide a real example of how this can happen.

    Regards

        Ed Willink

On 01/08/2013 09:35, Horacio Hoyos Rodriguez wrote:

Find in-line comments

 

Horacio Hoyos Rodríguez

EngD Student

University of York

 

http://www.york.ac.uk/docs/disclaimer/email.htm

 

From: qvtd-dev-bounces@xxxxxxxxxxx [mailto:qvtd-dev-bounces@xxxxxxxxxxx] On Behalf Of Ed Willink
Sent: 01 August 2013 07:13
To: QVTD developers mailing list
Subject: Re: [qvtd-dev] [Dev] QVTi UML2RDBMS faults

 

Hi Horacio

The type checking is an area where QVTc doesn't naturally inherit OCL semantics.

In OCL, a variable initialization must be type conformant.

In QVTc, a mapping binding reuses a Variable, but the type check is now a run-time predicate.

[Horacio Hoyos Rodriguez]

So I do have to check at runtime that the binding or variable initialization is of the specific type?



Multiple visits, same Mapping, same bound variables, can occur as a result of rule inheritance, but the flattening of rule inheritance should eliminate it. So there should be no need for any run-time support (I hope).

[Horacio Hoyos Rodriguez]

I see your point, but this might just happen as the effect of having two collection bindings in the mapping call. I know the transformation should try to avoid this, but I don’t know if it can be guaranteed, or if we should make it a restriction and then add additional mapping calls to comply.



    Regards

        Ed Willink

 

On 31/07/2013 16:51, Horacio Hoyos Rodriguez wrote:

Hi Ed,

 

After adding more debugging capabilities, I realized in the UMl2RDBMS transformation there is no guard at the mapping level to differentiate Primitive attributes from Complex ones. Thus, invoking the mapping calls:

 

map classPrimitiveAttributesLM {

        c := c;

        a <= c.attributes;

        fao := c2t;

    }

    map classComplexAttributesLM {

        c := c;

        a <= c.attributes;

        fao := c2t;

    }

 

Will treat primitive attributes as complex ones during invocation of the second call.  The type check at the mapping call level will work for primitives (t:PrimitiveDataType), but for complex attributes the check is at a higher level (a:Attribute) and thus primitive attributes will comply.

 

The next test in classComplexAttributesLM would be in the variable initializer: t := a.type;, however OCL is not complaining about a class being assigned a PrimitiveDataType… perhaps because they are both Classifiers?

 

I have to step through the variable visit method and see what is exactly going on.

 

I have pushed the changes to the TracingDecorator (it now also prints the middle model elements after a mapping bottom pattern is visited to know its state).

 

---

Other thing that has to be defined is how to deal with multiple visiting of the same element. There was a bug in the mapping call to classPrimitiveAttributesLM in classToTableLM, having an additional binding for p2n. Thus, all the attributes where visited three times (there are three p2n elements at that time) and the middle model ended up with three AttributeToColum elements for each primitive attribute. Possibly keep a list of visited elements and skip… but I don’t like that solution as some transformations (in my experience) require multiple visits to the same elements in the source model.

 

Regards,

 

 

Horacio Hoyos Rodríguez

EngD Student

University of York

 

http://www.york.ac.uk/docs/disclaimer/email.htm

 




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




No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3392 / Virus Database: 3209/6537 - Release Date: 07/30/13

 



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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3392 / Virus Database: 3209/6541 - Release Date: 07/31/13



Back to the top