|
Re: efxclipse AdapterService vs e4 IAdapterManager [message #1711922 is a reply to message #1711904] |
Tue, 20 October 2015 10:01 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Hi,
Yes only the efxclipse adapter service works with our @ContextValue (you
could file a bug report asking us to query the other system as well)
On the way: It is my personal believe that it should be possible to
write components without any dependency on other Eclipse
stuff while equinox-common in general is not that bad it
still is not as lightweight as org.eclipse.fx.core.
On the overhead of creating AdapterProviders for each type: I'd say if
you use @Component annotations this overhead is acceptable.
On ValueAccess: This allows you to retrieve extra information. Eg if the
adaption his happening through the DI-System you can access
IEclipseContext-Values through it.
Tom
On 20.10.15 11:32, Ali Karimi wrote:
> Hey there,
>
> i am developing an eclipse rcp 4 efxclipse application and currently i
> am a bit confused about the adapter mechanisms e4 and efxclipse provide.
> One the hand, the one provided by efxclipse as describes here
> https://wiki.eclipse.org/Efxclipse/Runtime/Recipes#Adapter_System
>
> and on the other hand the one provided by the eclipse e4 system
> described here:
> https://wiki.eclipse.org/E4/EAS/Adapting_Objects#e4_.28Java.29
>
> As far as i understood, if i want to inject my own objects with DI
> (using @ContextValue annotation) i should go with the efxclipse approach.
> Whereas the e4 approach seems to me to be a little bit more flexible, as
> it allows to adapt the source type to multiple target types by only
> using one implementation class acting as a factory. When using the
> efxlipse OSGI service i have to declare and register a new
> AdapterProvider for each adaption. I am thinking of a scenario where
> classA can be adopted to classB and classC.
>
> Maybe someone can sum up, why to choose the one approach over the other.
> Thanks in advance.
>
> P.S.: The AdapterProvider interface of efxclipse has a method adapt with
> the following signature:
>
> public T adapt(@NonNull S sourceObject, @NonNull Class<T> targetType,
> ValueAccess... valueAccess);
>
>
> Can anyone explain how the class ValueAccess works or provide a working
> example with full source code of the adapt method?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02351 seconds