| New Project: ServiceBinding-Utils |
|
|
| Written by Valery Abu-Eid | |
| Saturday, 13 September 2008 13:11 | |
|
I never thought that Consuming services in OSGi Environment using OSGi Framework API was an issue when I got familiar with OSGi and developed my first few applications, but when it was more than 20 times or so I understood that it's not the way to go. It's just cumbersome to write 30-50 lines of code every time you want to consume a service - This is considering that you just want your service to be up to date without taking ranking and other issues into account. Since most of the examples and applications at DynamicJava.org consume OSGi Services, it's very inefficient to spend not a small amount of time on things that doesn't relate to the presented application/example - Not mentioning that such code distracts the reader from the main point of the application. But why I didn't use Spring-DM? Taking into account that all of the applications at DynamicJava.org are very small (The ones that way more than 1 megabyte is because they include Felix, Equinox and Knopflerfish), using Spring-DM would have raised applications' size significantly and degraded its performance, and for the sole reason of binding services I think that this is unacceptable. For a long time I had the idea of writing an API that would allow me with 1-2 lines of code bind services to my objects without affecting application's size or performance, but the main challenge was keeping the code that uses such API as small and readable as possible. Finally, I reached a level where I believe that the project realizes it's minimum requirements, so I'm done with the first version of ServiceBinding-Utils. Take a look at it, I think it should be very beneficial for anyone who consumes OSGi Services but don't want to use a framework for the sole reason of binding services. If you think that the API is complex or can't handle certain cases, please, let us know. |