DS is an abstraction for OSGi created specifically for dynamic service resolution and injection for POJOs. In most cases it eliminates any need to deal with any low level OSGi API with the exception of some finge use cases.
DS is a reasonably powerful API that will handle the comings and goings of a dynamic environment including the various implementations of a service (think HTTP service). It does take some forethought though on how to manage them correctly and you do have to mind concurrency. Regardless, you would have the same issues with SeviceTracker but now you are also down into the OSGi APIs. On Thu, May 30, 2013 at 11:40 AM, David Jencks <[email protected]>wrote: > Felix DS uses the service tracker code to deal with references. (the > service tracker code needs some enhancement to provide notifications at the > right times) > > If the object that uses the services can be set up as a DS component, then > use DS. If for some reason it can't (perhaps there are conditions for its > creation that cannot be expressed as DS service dependencies) then create > the object in some other way and use service trackers for the references. > In a reasonably dynamic environment you are unlikely to get working code > if you try to deal with the services coming and going dynamically without > the service tracker code either directly or through DS. (I don't know how > reliable blueprint or IPOJO is, they are two other choices). > > hope this helps > david jencks > > On May 30, 2013, at 7:10 AM, Snorre Lothar von Gohren Edwin < > [email protected]> wrote: > > > Hi, im almoast finished with my assignement now and I want to thank all > who > > has answered for valuable feedback. It has guided me in the right > > direction and I appreciate it alot. > > But I have a last question. > > > > Service Tracker vs DS? Are there some situations that the other is > better. > > I have read this: > > http://njbartlett.name/2010/08/05/when-servicetrackers-trump-ds.html. > And > > seen that there are some cases. > > > > I have also read somwhere, but cant find it again, that if one want to > have > > a dynamic GUI, such as a main controller getting services, where the > > service provide gui for the main controller. Service tracker should also > be > > used. > > I dont know how DS can controll this dynamism that multiple > implementations > > of a service can come and go and instantiate a GUI coming from the > service. > > Or is this what multiple=true might be used for? I have not had the time > to > > try this out. > > > > -- > > Mvh > > Snorre Lothar von Gohren Edwin > > +47 411 611 94 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- -- Scott England-Sullivan Apache Camel Committer Principal Consultant / Sr. Architect | Red Hat, Inc. FuseSource is now part of Red Hat Web: fusesource.com <http://www.fusesource.com> | redhat.com<http://www.redhat.com> Blog: sully6768.blogspot.com Twitter: sully6768

