DI question [message #894204] |
Sat, 07 July 2012 12:18  |
Eclipse User |
|
|
|
DI enables to find a provider for a certain service in a well-defined
context.
Is there some way to get a list of *all* possible providers of some
well-defined service?
This would enable to build some kind of super-service that can either
chose what implementation is better suited in the specific situation or
to apply all services in sequence, all this without need to know in
advance which and how many different implementations of the same service
will be provided.
|
|
|
|
Re: DI question [message #894566 is a reply to message #894530] |
Mon, 09 July 2012 11:35   |
Eclipse User |
|
|
|
On 09/07/2012 16:15, Paul Webster wrote:
> OSGi has the notion of multiple provides of a service, and of properties
> and rankings that can help distinguish them.
>
> What kind of pattern is it you want to apply to your injected Object?
> Are you talking OSGi-like inter-bundle communication services?
I am working (personal project, in my spare time) to implement a full
fledged TextEditor for E4 (in it's own plugin).
I am starting from the standard SourceViewer and adding capabilities.
I was toying with the idea to provide a generic interface for hover,
syntax coloring and similar things. The user of the TextEditor could
provide one or more (e.g.) "hover services" and the global hover would
display all hovers that are compatible with the current location.
Same thing with Syntax coloring, spell-checking and other possible
Annotations.
This would enable to define a new Annotation, together with a way to
display it and, possibly, some display criteria and have the TextEditor
to automatically pick it up.
Is this a stupid idea, for some reason?
MC
|
|
|
Re: DI question [message #894691 is a reply to message #894566] |
Tue, 10 July 2012 03:37  |
Eclipse User |
|
|
|
Hi Mauro,
I think it is easier to archive your target with the usage of extension points. They are designed to have multiple contributors.
Best regards, Lars
|
|
|
Powered by
FUDForum. Page generated in 0.04978 seconds