I've in mind an intelligent system which can choose among available OSGi services dynamically. That is, choose an implementation or another depending of some runtime parameter. For example, notify to a running algorithm that change an operator after several iterations, or depending of load balancing in a system or whatever.
while(stopCriterion){
operator.doSomething(); //There exist many operator implementations
}
My first approach is to use DS to expose the services and bind services with 0..n and dynamic policy. Then, from an external intelligent component, notify the algorithm which service use in every iteration (using EventAdmin, maybe?).
operator[selected].doSomething();
This could help me to reduce complexity when many experiments with a lot of different service implementations must be executed. Also, I am planning to use Remote Services specification with Eclipse Communication Framework to make research in distributed algorithms and that stuff, so dynamically appearing of new implementations in execution time also could be possible
However, I don't know if is this a good idea or there exist another better mechanism to dynamically select which implementation use. I think that using ServiceTracker instead DS is not a good option, but I'm open to suggestions :)
Thanks in advance.