Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » DI question
DI question [message #894204] Sat, 07 July 2012 16:18 Go to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
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 #894530 is a reply to message #894204] Mon, 09 July 2012 14:15 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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?

PW


Re: DI question [message #894566 is a reply to message #894530] Mon, 09 July 2012 15:35 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
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 07:37 Go to previous message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

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
Previous Topic:Anyone ELSE have menu items disappear after updating Eclipse??
Next Topic:Processors
Goto Forum:
  


Current Time: Fri Apr 26 16:16:16 GMT 2024

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

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

Back to the top