andrew ennamorato wrote:I'm not real familiar with OSGi, so pardon the ignorance, but these statements sound familiar to what I've seen/read about NetKernel - i.e., using resources or services as objects. Is this a valid comparison? Or am I way off base?
My No-Fluff/Just-Stuff friend, Brian Sletton, will be disappointed to hear me say that I'm not real familiar with NetKernel. So pardon my ignorance on that subject and let me try to answer your question in a way that may clear it up (of course, if it doesn't, then by all means ask again).
Way back when, we wrote programs as a series of imperative statements. That was great, but then we realized that we could collect a set of imperatives into procedures. These procedures provided a form of modularity in our application. They were reusable, cohesive (ideally), and easy to understand chunks of an application. Furthermore, the contents of the procedure are unimportant to those who call that procedure, so we get a little data-hiding benefit as well.
Then we decided that those procedures (and the data they work with) could be wrapped up in things called classes and objects. The same benefits came from that, just at a slightly more coarse level.
OSGi represents another level of modularity where we take a set of classes, interfaces, and other artifacts and wrap them up in units that can be reused, tested in isolation, understood in small doses, and that hide the internals to those who consume those units. Internals are hidden by default unless (1) packages are explicitly exported or (2) services are explicitly published into the OSGi service registry.
Note that Java packages don't achieve any sort of modularity...they're just an organizational trick. And plain-vanilla JAR files don't achieve any true modularity because there's no way to hide internal details...once a JAR file is put on the classpath, the JAR file boundaries dissolve and it's just a bunch of stuff on the classpath that everyone can see and use.
So...looking at it from this view, OSGi doesn't try to solve the same kinds of problems that SOA solutions solve. It just happens to employ an SOA model within a given VM. (Again, OSGi's SOA has nothing to do with web services, REST, HTTP or any other remoting.)