Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Library search path
[QVTO] Library search path [message #488216] Sat, 26 September 2009 01:27 Go to next message
Derek Palma is currently offline Derek PalmaFriend
Messages: 141
Registered: July 2009
Senior Member
Hi,

It looks like library modules are searched for using the location of the
referencing transformation. Is there any classpath like search mechanism
that can be configured? I am tried to avoid making a directory hierarchy
with all libraries located with respect to their namespace names. My
understanding is the namespace names map to filesystem directories with the
same name, like with Java.

Thanks
Derek
Re: [QVTO] Library search path [message #488299 is a reply to message #488216] Sun, 27 September 2009 19:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Derek,

Compilation units are resolved by simple or qualified name (prefixed with
name-space).
A compilation unit in a name-space can always be resolved using its simple
name
by a compilation unit within the same name-space, so the importer can
deduce the
imported qualified name.

This should be analogous to Java though in QVTO the import statement refers
to a compilation unit (file), which typically contains a module (lib or
transf)
to be explicitly imported either by 'access' or 'extends' semantics.

Regards,
/Radek


On Sat, 26 Sep 2009 03:27:49 +0200, Derek Palma <derek.palma@gmail.com>
wrote:

> Hi,
>
> It looks like library modules are searched for using the location of the
> referencing transformation. Is there any classpath like search mechanism
> that can be configured? I am tried to avoid making a directory hierarchy
> with all libraries located with respect to their namespace names. My
> understanding is the namespace names map to filesystem directories with
> the same name, like with Java.
>
> Thanks
> Derek
Re: [QVTO] Library search path [message #488302 is a reply to message #488299] Sun, 27 September 2009 20:23 Go to previous messageGo to next message
Derek Palma is currently offline Derek PalmaFriend
Messages: 141
Registered: July 2009
Senior Member
Hi Rakek,

It seems if I in my referencing transformation I put:
import com.virtunomic.qvt.Library;

Library.qvto is searched for in the com/virtunomic/qvt directory relative to
where the referencing transformation is located. So it seems the namespace
is location mechanism as well as a naming mechanism. Hence, if I don't want
to use mutliple directories to hold my .qvto files, I should just not
specify any imports with namespaces. Right? I just need to make sure my
Library declarations have unique names.

Also, what is the preferred way of accessing libraries? extends/access seem
to be talked about more in the spec but I noticed I can access the contents
of my libraries just by merely importing them and not using extends or
access in the transformation declaration.

Thanks,
Derek


"radek dvorak" <dvorak.radek@gmail.com> wrote in message
news:op.u0xj61z512y5f2@kliste.local...
> Hi Derek,
>
> Compilation units are resolved by simple or qualified name (prefixed with
> name-space).
> A compilation unit in a name-space can always be resolved using its simple
> name
> by a compilation unit within the same name-space, so the importer can
> deduce the
> imported qualified name.
>
> This should be analogous to Java though in QVTO the import statement
> refers
> to a compilation unit (file), which typically contains a module (lib or
> transf)
> to be explicitly imported either by 'access' or 'extends' semantics.
>
> Regards,
> /Radek
>
>
> On Sat, 26 Sep 2009 03:27:49 +0200, Derek Palma <derek.palma@gmail.com>
> wrote:
>
>> Hi,
>>
>> It looks like library modules are searched for using the location of the
>> referencing transformation. Is there any classpath like search mechanism
>> that can be configured? I am tried to avoid making a directory hierarchy
>> with all libraries located with respect to their namespace names. My
>> understanding is the namespace names map to filesystem directories with
>> the same name, like with Java.
>>
>> Thanks
>> Derek
Re: [QVTO] Library search path [message #488305 is a reply to message #488302] Sun, 27 September 2009 21:26 Go to previous message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Some comments in-lined below.

> It seems if I in my referencing transformation I put:
> import com.virtunomic.qvt.Library;
>
> Library.qvto is searched for in the com/virtunomic/qvt directory
> relative to where the referencing transformation is located. So it seems
> the namespace is location mechanism as well as a naming mechanism.
> Hence, if I don't want to use mutliple directories to hold my .qvto
> files, I should just not specify any imports with namespaces. Right? I
> just need to make sure my Library declarations have unique names.
>

I think there is an issue with name-space resolution at deployment time.
The
name-space is resolved against the source folder, which is recognized
only in workspace at development time. Looks like the importer's location
is taken
instead when deployed as the source folder info is missing.
This problem is gone if compiled QVTO XMI is executed instead of
*.qvto source files. In this case the standard EMF model cross-referencing
mechanism is involved. This feature is in progress.

So please, avoid name-spaces if possible until we fix this.

> Also, what is the preferred way of accessing libraries? extends/access
> seem to be talked about more in the spec but I noticed I can access the
> contents of my libraries just by merely importing them and not using
> extends or access in the transformation declaration.
>

This kind of implicit import is for backward compatibility, internally it's
compiled as import by access of the module from the imported compilation
unit.
The users should better specify explicit module import either by access or
extends.

I think you will mostly need the 'access' semantics. The other variant
is useful for instance in case you want to override some operations in the
library
to provide specific behavior.
Previous Topic:[QVTO] cloning self
Next Topic:[ATL] Lazy rules with multiple parameters
Goto Forum:
  


Current Time: Fri Apr 26 23:38:37 GMT 2024

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

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

Back to the top