Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [TCS] Injector ATL dependency
[TCS] Injector ATL dependency [message #2442] Fri, 22 February 2008 06:25 Go to next message
Eclipse UserFriend
Hi,

I like the way you made most of the code independent from atl.engine code,
as IMO this dependency should be contained in ASMModelAdapter alone.
However, there are still dependencies in TCSInjector.
For me, it would be ideal if basically the whole
org.eclipse.gmt.tcs.injector project had no references at all to atl
libraries, as we would be able to generate Injectors that are independent
from atl that way, and if we do not want to use the ASMModelHandler, we
would not need this dependency.

Also, to my very personal subjective taste, it would be great to have the
parameters used in TCSInjector.inject() in a Bean rather than a map, to
make the interface explicit. Also, for the problems model
ASMModel problems = (ASMModel)params.get("problems");
introduces a kind of dependency that is hard for me to tackle if I want to
avoid using ASMModel. Could this be replaced or wrapped in some interface?

I guess you are working on these things anyways, so don't think of this as
a critique, I think you are doing a great job.
Re: [TCS] Injector ATL dependency [message #2528 is a reply to message #2442] Sat, 23 February 2008 09:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

TCSInjector is the ASMModel-based API to call TCS. During the recent
improvements, we created ParserLauncher, which is the generic API.

Therefore, I would suggest that you write your own injector class that
will use your own ModelAdapter, and invoke ParserLauncher. As you can
see in TCSInjector.java (almost empty now that the generic part has been
extracted), this is quite easy to do.


Regards,

Frédéric Jouault

Thibault a écrit :
> Hi,
>
> I like the way you made most of the code independent from atl.engine
> code, as IMO this dependency should be contained in ASMModelAdapter alone.
> However, there are still dependencies in TCSInjector.
> For me, it would be ideal if basically the whole
> org.eclipse.gmt.tcs.injector project had no references at all to atl
> libraries, as we would be able to generate Injectors that are
> independent from atl that way, and if we do not want to use the
> ASMModelHandler, we would not need this dependency.
>
> Also, to my very personal subjective taste, it would be great to have
> the parameters used in TCSInjector.inject() in a Bean rather than a map,
> to make the interface explicit. Also, for the problems model
> ASMModel problems = (ASMModel)params.get("problems");
> introduces a kind of dependency that is hard for me to tackle if I want
> to avoid using ASMModel. Could this be replaced or wrapped in some
> interface?
>
> I guess you are working on these things anyways, so don't think of this
> as a critique, I think you are doing a great job.
>
Re: [TCS] Injector ATL dependency [message #2557 is a reply to message #2528] Mon, 25 February 2008 04:52 Go to previous messageGo to next message
Eclipse UserFriend
Hi Frédéric,

> TCSInjector is the ASMModel-based API to call TCS. During the recent
> improvements, we created ParserLauncher, which is the generic API.
>
> Therefore, I would suggest that you write your own injector class that
> will use your own ModelAdapter, and invoke ParserLauncher. As you can
> see in TCSInjector.java (almost empty now that the generic part has been
> extracted), this is quite easy to do.

I can indeed, my problem is that in the TCS2ANTLR.ATL script, a generated
parser will always have
public org.eclipse.gmt.tcs.injector.TCSRuntime ei = null;
thus there is a compile time dependency to your implementation of an
injector and thus to the ASMModel-based API.
If TCSInjector was just a java-interface, shipped in a bundle without
ASM-Model dependencies, separation of concerns (Injector generation vs.
which Modelling API to use) would appear to be better to me.
Re: [TCS] Injector ATL dependency [message #2586 is a reply to message #2557] Mon, 25 February 2008 06:47 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

We separared the old TCSInjector into the new TCSInjector,
ParserLauncher, and TCSRuntime. The objective is to make injection
possible with only ParserLauncher, and TCSRuntime, which do not depend
on the ASMModel-based API any more.

You only need ParserLauncher and TCSRuntime to make an injector with a
different ModelAdapter. If we missed some dependency from TCSRuntime to
the ASMModel-based API, please tell us so that we can remove it.


Regards,

Frédéric Jouault

Thibault a écrit :
> Hi Frédéric,
>
>> TCSInjector is the ASMModel-based API to call TCS. During the recent
>> improvements, we created ParserLauncher, which is the generic API.
>>
>> Therefore, I would suggest that you write your own injector class that
>> will use your own ModelAdapter, and invoke ParserLauncher. As you can
>> see in TCSInjector.java (almost empty now that the generic part has
>> been extracted), this is quite easy to do.
>
> I can indeed, my problem is that in the TCS2ANTLR.ATL script, a
> generated parser will always have
> public org.eclipse.gmt.tcs.injector.TCSRuntime ei = null;
> thus there is a compile time dependency to your implementation of an
> injector and thus to the ASMModel-based API.
> If TCSInjector was just a java-interface, shipped in a bundle without
> ASM-Model dependencies, separation of concerns (Injector generation vs.
> which Modelling API to use) would appear to be better to me.
>
Re: [TCS] Injector ATL dependency [message #2613 is a reply to message #2586] Mon, 25 February 2008 08:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi Frédéric,

I am sorry, what I wrote did not make any sense. I thought you still used
TCSInjector instead of TCSRuntime, even though in the part I cited
TCSRuntime was being used. I just need some glasses.

thanks for your patience,
Thibault
Re: [TCS] Injector ATL dependency [message #2641 is a reply to message #2613] Mon, 25 February 2008 11:57 Go to previous message
Eclipse UserFriend
Hi Thibault,

> I am sorry, what I wrote did not make any sense. I thought you still
> used TCSInjector instead of TCSRuntime, even though in the part I cited
> TCSRuntime was being used. I just need some glasses.
> thanks for your patience,

You are welcome.

Please let us know about your progress :-).


Thanks,

Frédéric Jouault
Previous Topic:[TCS] IModelHandler
Next Topic:[TCS] KM3 unique attribute
Goto Forum:
  


Current Time: Sun Jul 13 17:38:47 EDT 2025

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

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

Back to the top