<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>All the small things &#187; Specifications</title>
	<atom:link href="http://osgi.mjahn.net/category/specifications/feed/" rel="self" type="application/rss+xml" />
	<link>http://osgi.mjahn.net</link>
	<description>that still do matter</description>
	<lastBuildDate>Tue, 28 Aug 2012 22:01:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>Making myself obsolete &#8211; well maybe.</title>
		<link>http://osgi.mjahn.net/2010/03/03/making-myself-obsolete-well-maybe/</link>
		<comments>http://osgi.mjahn.net/2010/03/03/making-myself-obsolete-well-maybe/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 23:29:15 +0000</pubDate>
		<dc:creator>Mirko Jahn</dc:creator>
				<category><![CDATA[Inspector]]></category>
		<category><![CDATA[JSR 291]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apache License]]></category>
		<category><![CDATA[ASL]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[solver]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://osgi.mjahn.net/?p=212</guid>
		<description><![CDATA[I admit it: &#8220;Using OSGi for the first time isn&#8217;t as fun as any of the hip new scripting languages.&#8221; Actually, it can be quite painful &#8211; especially in the beginning. You&#8217;re forced to think about things you actually don&#8217;t &#8230; <a href="http://osgi.mjahn.net/2010/03/03/making-myself-obsolete-well-maybe/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I admit it: &#8220;Using OSGi for the first time isn&#8217;t as fun as any of the hip new scripting languages.&#8221; Actually, it can be quite painful &#8211; especially in the beginning. You&#8217;re forced to think about things you actually don&#8217;t want to &#8211; or better put &#8211; you thought you don&#8217;t want to. The good news is that there is tooling support (like: <a title="external: BND Home Page" href="http://www.aqute.biz/Code/Bnd" target="_blank">BND</a>, <a title="external: Apache Felix Maven Bundle Plugin" href="http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html" target="_blank">maven-bundle-plugin</a> or <a title="external: Eclipse PDE Website" href="http://www.eclipse.org/pde/" target="_blank">Eclipse PDE</a>) that can help you getting around most of the time. Unfortunately, there is still the remaining bit, that keeps nagging your brain with the &#8220;what could possible have gone wrong&#8221;. The one thing that bothered me most about it is that in many cases the steps you need to figure out what&#8217;s wrong are the same. It is simple, repetitive work you have to do, mostly only using basic OSGi know how. Also surprisingly simple, there is no tool at hand that can help you going through the necessary steps &#8211; well, till now. Lately I was so annoyed by the situation, that I started my own little open source project, aiming to fight this exact problem. Getting you up to speed and solving the simple problems you usually have when working with OSGi &#8211; especially when you start using OSGi, was my goal to achieve.</p>
<p>So, I am happy to introduce the (OSGi)&#8230;</p>
<p><a href="http://osgi.mjahn.net/wp-content/uploads/2010/02/inspector_mj_blog.png"><img class="size-full wp-image-213 alignnone" style="border: 0px;" title="Thanks Ina for the great image!" src="http://osgi.mjahn.net/wp-content/uploads/2010/02/inspector_mj_blog.png" alt="Thanks Ina for the great image!" width="515" height="268" /></a></p>
<p>Before going on explaining what it is about, what it can do and why you might wonna take a look at it, be warned! As of now, it is still a proof of concept project. It sure does offer help and is better than nothing, but I am not satisfied with some details of the API and implementation, so expect severe changes within the next couple of weeks (if not months). You&#8217;ve been warned <img src='http://osgi.mjahn.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Anyway, the goal behind the inspector is to offer a simple framework to detect common coding mistakes in OSGi. Very simple things manifesting in ClassNotFoundExceptions, missing services, unresolved bundles or not attached fragments. It certainly is not the &#8220;one to rule them all&#8221; solution, but it is a (hopefully) decent effort to help you move faster with your OSGi development.</p>
<p>So, what is the inspector really. Currently, the inspector consists of three major parts: the core, the reasoner and the web GUI. The core offers basic functionality to analyze the running OSGi environment in a convenient way. This includes, but is not limited to:</p>
<ul>
<li>imported, exported packages with their versions, properties and directives</li>
<li>provided services</li>
<li>pending, removed and failed service requests (partially depending on a R4.2 runtime)</li>
<li>framework events with special treatment of errors</li>
<li>dynamic imports</li>
<li>fragments</li>
<li>framework capabilities</li>
<li>class look-up within the runtime (which bundles provide a specific class?)</li>
<li>&#8230;</li>
</ul>
<p>This all is realized in one single bundle you have to deploy and start as the first bundle in your OSGi runtime (any runtime is fine, as long it is a R4.x one from any implementer).</p>
<p>The reasoner is the second bundle and provides the logic to solve your common problems it uses the core bundle for getting the required information to make reasonable guesses on what&#8217;s wrong and even more important, on how to fix it quickly. This part is the most experimental one. The idea is to have an extendable API that is not limited to standard OSGi problems but can be extended to solve your domain specific problems as well. The current implementation only includes one use case yet &#8211; ClassNotFoundExceptions propagated to the OSGi runtime. Other reasoners are already work in progress like failing service requests, missing services and not resolved bundles in general (bundles and fragments actually). If you can think of other common OSGi problems, please let me know!</p>
<p>The web gui is a convenient way to take a look at the discovered problems and the suggested solutions. It is very simple and straight forward in order to solve the problems at hand. You don&#8217;t need to use it, you could also create a simple command line tool doing exactly the same. I actually would have preferred a command line tool over a web gui, but because of the lack of a common API to provide command line extensions over OSGi implementation, I decided to not yet provide something right now. Maybe later if the the feedback suggests otherwise.</p>
<p>To get you started in no time, I also provide an assembly based on pax-runner that starts all bundles required correctly and allows for easy provisioning of your own domain specific bundles. There is even a very simple tutorial available at <a title="external: Inspector Tutorial" href="http://wiki.github.com/mirkojahn/OSGi-Inspector/tutorial" target="_blank">github</a>.</p>
<p>So, if you&#8217;re interested, take a look at it, give it a spin and let me know what you&#8217;re thinking! Any feedback is greatly appreciated!</p>
<p>Here the links for further details:</p>
<p>Binary download: <a title="external: Download site" href="http://github.com/mirkojahn/OSGi-Inspector/downloads" target="_blank">http://github.com/mirkojahn/OSGi-Inspector/downloads<br />
</a>Tutorial: <a title="external: Inspector Tutorial" href="http://wiki.github.com/mirkojahn/OSGi-Inspector/tutorial" target="_blank">http://wiki.github.com/mirkojahn/OSGi-Inspector/tutorial</a><br />
Source Code: <a title="external: Source Code (Apache Version 2 License)" href="http://github.com/mirkojahn/OSGi-Inspector" target="_blank">http://github.com/mirkojahn/OSGi-Inspector<br />
</a>Bug tracking: <a title="external: Bug tracking" href="http://github.com/mirkojahn/OSGi-Inspector/issues" target="_blank">http://github.com/mirkojahn/OSGi-Inspector/issues</a></p>
<p>I also have plans for additional features for the next version (maybe this summer) of the inspector, like making the Web GUI extendable, including more JVM information and debugging capabilities like heap dumps or per bundle memory usage, statistics about the application like running threads, used frameworks and their versions, runtime bundle dependencies, search over many of the aforementioned features and much more, but this will be mainly based on user feedback. So stay tuned and let me know what you&#8217;re missing.</p>
<p>Finally here are some screen shot to give you an idea how the proof of concept looks right now <img src='http://osgi.mjahn.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a href="http://osgi.mjahn.net/wp-content/uploads/2010/03/welcome_screen.jpg"><img class="alignnone size-full wp-image-223" style="border: 0px initial initial;" title="Inspector Welcome Screen" src="http://osgi.mjahn.net/wp-content/uploads/2010/03/welcome_screen.jpg" alt="" width="515" /></a></p>
<p><a href="http://osgi.mjahn.net/wp-content/uploads/2010/03/runtimeProblems_screen.jpg"><img class="alignnone size-full wp-image-224" style="border: 0px initial initial;" title="Runtime Problems Screen" src="http://osgi.mjahn.net/wp-content/uploads/2010/03/runtimeProblems_screen.jpg" alt="" width="515" /></a></p>
<p>As a final note, one may ask if OSGi experts are becoming obsolete by tool support like this. I don&#8217;t think so! In my opinion, this is something that is crucial for a wider OSGi adoption and an important helper to silence the OSGi opponents by solving 90% of the beginner problems with regard to basic programming errors. It can serve as a teaching tool to tell people what not to do or how to do things better. OSGi experts now can focus on the important stuff like how to design and build truly modular applications &#8211; as they should have been for a while.</p>
<p>Yours,<br />
Mirko</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fosgi.mjahn.net%2F2010%2F03%2F03%2Fmaking-myself-obsolete-well-maybe%2F&amp;title=Making%20myself%20obsolete%20%E2%80%93%20well%20maybe." id="wpa2a_2"><img src="http://osgi.mjahn.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://osgi.mjahn.net/2010/03/03/making-myself-obsolete-well-maybe/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Extenders in OSGi &#8211; what is all the buzz about?</title>
		<link>http://osgi.mjahn.net/2009/03/04/extenders-in-osgi-what-is-all-the-buzz-about/</link>
		<comments>http://osgi.mjahn.net/2009/03/04/extenders-in-osgi-what-is-all-the-buzz-about/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 02:14:07 +0000</pubDate>
		<dc:creator>Mirko Jahn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JSR 291]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[extender]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pattern]]></category>

		<guid isPermaLink="false">http://osgi.mjahn.net/?p=98</guid>
		<description><![CDATA[It feels like recently extenders became extremely fashionable among the OSGi community. Eclipse is using an extender like pattern to track their plugin.xml configurations and Spring DM introduced the plain osgi extender together with a special web extender. It seems &#8230; <a href="http://osgi.mjahn.net/2009/03/04/extenders-in-osgi-what-is-all-the-buzz-about/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It feels like recently extenders became extremely fashionable among the OSGi community. <a title="external: Eclipse.org Website" href="http://www.eclipse.org" target="_blank">Eclipse</a> is using an extender like pattern to track their <a title="external: plugin.xml usage - a simple tutorial" href="http://www.eclipse.org/articles/Article-Your%20First%20Plug-in/YourFirstPlugin.html" target="_blank">plugin.xml</a> configurations and <a title="external: Spring DM aka Spring OSGi" href="http://www.springsource.org/osgi" target="_blank">Spring DM</a> introduced the plain osgi <a title="external: Spring extender" href="http://static.springframework.org/osgi/docs/current/reference/html/bnd-app-ctx.html#bnd-app-ctx:extender" target="_blank">extender</a> together with a special <a title="external: Spring Web Extender" href="http://static.springframework.org/osgi/docs/current/reference/html/web.html#web:configuration" target="_blank">web extender</a>. It seems like everyone has one lately, but what is all the buzz about and how should or could you use one &#8211; and even more important, when should you use one. As always in software development there is no clear black and white answer to this, but this blog post at least tries to shade some light on this topic to help you making the right decisions.</p>
<p><strong>The buzz, what is it about?</strong></p>
<p>Before the extender hit the light, people were advertising the white board pattern as THE OSGi way of doing things. A way of inverting control, taking the burden of house keeping from the consumer like it is required with the well known listeners. On the OSGi website you can even find a good paper on &#8220;<a title="external: listeners considered harmful [pdf]" href="http://www.osgi.org/wiki/uploads/Links/whiteboard.pdf" target="_blank">why listeners are considered harmful</a>&#8220;. Well, things change or better progress and with the extender another problem got addressed. The inconvenient with the white board pattern is that the client still has to take care of some stuff ending up in boilerplate code. Here is where the extender has its strengths. The core idea is to have a designated bundle that scans all already deployed bundles as well as all bundles that are being deployed during runtime for specific features, properties, interfaces, annotations, what ever you want in order to take appropriate actions on behave of this bundle. These actions can be something simple as registering a service for every implementation of a certain interface or as complex as doing some xml transformations of configuration files that will be loaded in your system triggering a whole cascade of events. The key point is that it is completely up to the extender what to do and how during deploy time.</p>
<p>Imagine you have your application extensively using the white board pattern without an extender. All &#8220;consumers&#8221; of your service have to publish a specific service in the registry in order to get recognized. You have to exactly specify what the signature of this service has to be. This can be any number of interfaces or just properties you register along with the service. All this is just fine, but when it comes to changes of your approach you have to let all you&#8217;re clients know about the changes and wait till they have adapted/ migrated or provide a runtime compatibility layer that checks for the old and the new syntax. With the extender, you can still use the white board pattern, but this time you take care of registering the service. Now, everything is defined in your extender, which interfaces are important, what properties to add. As soon as it comes to a change in your design, chances are good that you can just adapt the extender in order to register the client services with new properties, use different interfaces (if possible of course) or even use something advanced as a generic proxy that wraps around the old interface and registers itself with the new API. You can now intercept service calls, if you like or need and transform the transfered data as you please. But the best thing about it, despite the mentioned is that all this happens during deploy time of the bundle so it just happens once without the need for your clients to touch any of their code. This makes the interfaces between service providers and consumers more solid and less likely to break.</p>
<p><strong>Pros and Cons &#8211; abridge </strong></p>
<p>Of course, there is no such thing as free lunch. The extender also has its limitations, you should well be aware of. Here is a short list with the compiled pros and cons. Of course, depending on the scenario you might find more to either ones. If you think I forgot something important or don&#8217;t agree, don&#8217;t hesitate to comment. Constructive feedback is always appreciated.</p>
<p><em>disadvantages</em>:</p>
<p>- One of the first things that pops into ones mind is the problem of disabling the extender for a specific bundle. This might be interesting, because you don&#8217;t want to start/enable all bundles at start-up or just don&#8217;t want to provide all the functionality at once (f.i. to increase start-up speed). There are ways, like white/ black listing bundles, lazy activation triggered by properties or manual selection based user input. Although all this is possible, it is somewhat against the idea of the extender, which is automatically processing and removing repetitive tasks.<br />
- The second difficulty is the customization. Of course you can define a specific format that enables you to customize the way your extender works and what it does, but there are scenarios where you can&#8217;t upfront decide what to do. A common way to work around this is defining your own DSL describing your &#8220;intent&#8221; in an abstract way, like in your own DSL. However, this introduces another layer of complexity and can make your application/design even more complex &#8211; depending on your scenario of course. This is not a problem of the extender, but a general problem one usually faces when working in OSGi. Everything is intended to be generic, but at some point you have to be specific on what you actually wonna do. So, I guess it is not a real drawback, but something to consider.<br />
- Last but not least every automatic mechanism requires awareness of developers. Everyone using your bundles should be aware that something is happening behind the curtains. Otherwise chances are high the mechanism will be circumvented or miss used. Again, I think this holds true for many mechanism or patterns, but is well worth mentioning here.</p>
<p><em>advantages (assuming done right)</em>:</p>
<p>- First of all an extender means less burden for the developer. The overall goal is to remove boilerplate code, typical copy &amp; paste use cases and deterministic, error prone tasks. For most developers this is not only boring, but also a major pain point when fixing a bug or misconfiguration. By eliminating or at least minimizing such repeating tasks, you&#8217;re doing the average Joe and ultimately yourself a big favor.<br />
- You might have guessed it. Eliminating c&amp;p from your code base also makes your application more robust to changes. I mentioned that already above, but just let me emphasize that the ability to express the intend, rather then the actual how is one of the greatest advantages.<br />
- Inversion of Control. Yes, I know it is a buzz word and it is usually used grasp attention, but here it really makes sense. Like the whiteboard pattern one does remove the burden of the consumer. What kind of burden this is, depends on the extender. In many cases it will be registering the services the right way, indicating a specific functionality or setting a configuration. The beauty about this is similar to the white board pattern. Less burden for the &#8220;extendee&#8221; (the one being extended by an extender) and a centralized management logic, which can be updated, improved by the &#8220;extender&#8221;. I think it is important to note here that the extender can provide or consume, depending on your design, unlike the white board pattern.<br />
- Of course, one advantage generates others like less source code for instance. Unless you&#8217;re getting paid by lines of code you&#8217;re producing (just a joke -I honestly hope no one is evaluated on that one!), having a smaller code base is always a good thing. Other advantages would be less complex extendee bundles or simpler adaption to new requirements.</p>
<p><strong>Conclusion and outlook</strong></p>
<p>As you could see, extenders are the next evolutional step in the OSGi world. There are great new ways of designing your applications that can make your application even more robust and simpler to use. However, there also comes the responsibility to use the technology wisely and not just for the sake of it. As seen with Eclipse and now Spring, more and more advanced extender concepts are popping up and we certainly haven&#8217;t seen everything possible yet. In a future blog post, I am going to look deeper in how to create an actual extender, what to keep in mind, how the up-coming <a title="external: OSGi R4.2 specification - draft 2 [pdf]" href="http://www.osgi.org/download/osgi-4.2-early-draft2.pdf" target="_blank">OSGi R4.2</a> spec will help us here, what kind of extenders are there already and of course common pitfalls one may face implementing your own. Stay tuned and have fun experimenting with extenders.</p>
<p>Cheers<br />
Mirko</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fosgi.mjahn.net%2F2009%2F03%2F04%2Fextenders-in-osgi-what-is-all-the-buzz-about%2F&amp;title=Extenders%20in%20OSGi%20%E2%80%93%20what%20is%20all%20the%20buzz%20about%3F" id="wpa2a_4"><img src="http://osgi.mjahn.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://osgi.mjahn.net/2009/03/04/extenders-in-osgi-what-is-all-the-buzz-about/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Dynamic Import Issue</title>
		<link>http://osgi.mjahn.net/2009/02/05/the-dynamic-import-issue/</link>
		<comments>http://osgi.mjahn.net/2009/02/05/the-dynamic-import-issue/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 01:09:23 +0000</pubDate>
		<dc:creator>Mirko Jahn</dc:creator>
				<category><![CDATA[Componentization]]></category>
		<category><![CDATA[JSR 291]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[buddy class loading]]></category>
		<category><![CDATA[dynamic import]]></category>
		<category><![CDATA[implementation lookup]]></category>

		<guid isPermaLink="false">http://osgi.mjahn.net/?p=93</guid>
		<description><![CDATA[After some less OSGi technology centric posts I am now getting back to the meat and will highlight the problems involved with dynamic imports. In well designed OSGi applications the &#8220;DynamicImport-Package&#8221; header should be obsolete. Unfortunately not every code is &#8230; <a href="http://osgi.mjahn.net/2009/02/05/the-dynamic-import-issue/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After some less OSGi technology centric posts I am now getting back to the meat and will highlight the problems involved with dynamic imports. In well designed OSGi applications the &#8220;DynamicImport-Package&#8221; header should be obsolete. Unfortunately not every code is OSGi aware. Actually it is not the missing OSGi awareness that is the core of the problem. It is more the notion of making wrong assumptions on the visibility of classes and the misuse of context class loaders in 90% of the cases I saw. But what is the problem in a concrete example?</p>
<p>Well, a common example is JAXB. You have a library/API bundle which for itself provides no real functionality, but needs to be &#8220;enhanced&#8221;. You need actual implementations to provide functionality. Unfortunately your library needs access to those classes. OSGi is very strict with its class path definition. This is done in a static manner and has to be set during build time of your bundle (Import-Package header in the manifest), but your library provider has no idea about the implementation bundles (and it shouldn&#8217;t!). As you can see there is no way of defining such dependencies at built-time. In OSGi the only way to enable this without modification of the bundle code is to include a dynamic import header.</p>
<p>Eclipse soon realized that this is an issue. Especially the undirected import forces in many cases a binding to bundles that are not really related to the bundle defining the import. This causes issues with restarts and updates of the library bundle, because a lot, if not all bundles, can be affect by that. Even worse, it can mean that you end up finding the wrong classes (and I am not yet talking about versions). Eclipse, while migrating to OSGi had a huge amount of legacy code not aware of OSGi concepts and so they were the first really feeling the pain. That&#8217;s why the Eclipse community introduced the concept of <a title="external: Eclipse Buddy Class Loading explained" href="http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements" target="_blank">buddy class loading</a>. Although a better way by providing a scope (you have to define that you&#8217;re a contributor on the one side and declare that you&#8217;re open for that on the other side), it doesn&#8217;t solve the problem of different versions or provider selection in general. </p>
<p>Quiet a few people assume this is the only way to work around this kind of problems and they are correct when you don&#8217;t have the possibility of adding you&#8217;re own mechanisms or the API prevents other measures. However, if you have the access to the source, it is likely that you actually can do something that solves the problem. </p>
<p>While working on my thesis, some years ago, I came across this problem and in some cases you are able to use basic OSGi mechanisms to get what you need. The core idea and the requirement is, that the library needs the implementation class and offers a way to either inject the object or tweak the class loading mechanism to actually find the class you are looking for. So the question is how to gain access to the implementation object or its class loader for that matter. For the ones familiar with OSGi this should be obvious. We instantiate the implementation in our implementation bundle and offer that one as a service. We can register that object with the interface(s) theses classes are implementing or the annotation class they got annotated with. This is an universal key to identify the correct service. The nice thing about this is also that OSGi will handle the version problem for free. With Spring or the up coming <a title="external: [pdf] OSGi R4.2 draft 2" href="http://www.osgi.org/Download/File?url=/download/osgi-4.2-early-draft2.pdf" target="_blank">RFC 124</a> we don&#8217;t even have to write a single line of code in most cases, we don&#8217;t even have to touch the bundle. All we need is to provide is a fragment attached to the implementation bundle with a spring configuration inside creating a bean and publishing that one as a service.</p>
<p>Ok, we now have our implementation objects flying around in the ServiceRegistry. The next step is providing access to those objects in our library bundle. This is the actual tricky part and the point where you&#8217;ll most likely will face problems. Your API needs to provide a way of injecting these service objects and should allow you to dynamically manage them (add/remove/update). Otherwise you&#8217;ll end up with a static solution that once started won&#8217;t be able to adapt to the dynamic nature of OSGi. If you&#8217;re API provides/ uses a class loader look up that can be tweaked you&#8217;re the lucky one. Here you can provide a delegating class loader that dynamically queries the ServiceRegistry for the fitting object and returns its class loader. This is what we did in our <a title="external: Adopting OSGi in UIMA @ sys-con.com" href="http://java.sys-con.com/node/449864" target="_blank">OSGi-efied UIMA</a> implementation. The drawback here is, once you provided the defining class loader you lost control on how to resolve others unless your library has some mechanisms for that, which is unfortunately not very likely.</p>
<p>As you&#8217;ve seen, you not always have to go for a dynamic import. All the mentioned approaches have their advantages and disadvantages and none of them are &#8220;perfect&#8221;, but at least you have the choice choosing the one fitting best to the specific problem context.</p>
<p>If you found other ways of migrating problematic legacy code, please let me know. Maybe there is a solution out there, I was just not aware of. You never know <img src='http://osgi.mjahn.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Cheers,<br />
Mirko</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fosgi.mjahn.net%2F2009%2F02%2F05%2Fthe-dynamic-import-issue%2F&amp;title=The%20Dynamic%20Import%20Issue" id="wpa2a_6"><img src="http://osgi.mjahn.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://osgi.mjahn.net/2009/02/05/the-dynamic-import-issue/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Componentization wars part II &#8211; Guerrilla tactics</title>
		<link>http://osgi.mjahn.net/2008/12/04/componentization-wars-part-ii-guerrilla-tactics/</link>
		<comments>http://osgi.mjahn.net/2008/12/04/componentization-wars-part-ii-guerrilla-tactics/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 21:36:33 +0000</pubDate>
		<dc:creator>Mirko Jahn</dc:creator>
				<category><![CDATA[Componentization]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSR 277]]></category>
		<category><![CDATA[JSR 294]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[OSGi]]></category>

		<guid isPermaLink="false">http://osgi.mjahn.net/?p=79</guid>
		<description><![CDATA[Usually when I am blogging, I am talking about the latest technology, standards or general trends. This time however, I wonna talk about politics. No, not about the elections in US, but about politics in software development practiced by the &#8230; <a href="http://osgi.mjahn.net/2008/12/04/componentization-wars-part-ii-guerrilla-tactics/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Usually when I am blogging, I am talking about the latest technology, standards or general trends. This time however, I wonna talk about politics. No, not about the elections in US, but about politics in software development practiced by the big players to achieve their business goals. Don&#8217;t get me wrong from the start. I think this is completely normal in general. We all are trying to achieve our goals the one way or the other, but something just doesn&#8217;t feel right&#8230;</p>
<p>Yesterday I read about the latest <a title="external link: Mark Reinhold's blog" href="http://blogs.sun.com/mr/entry/jigsaw" target="_blank">news</a> concerning Sun&#8217;s plans about the future of <a title="external link: JSR 277" href="http://jcp.org/en/jsr/detail?id=277" target="_blank">JSR 277</a>, <a title="external link: JSR 294" href="http://jcp.org/en/jsr/detail?id=294" target="_blank">JSR 294</a> and its new plans on inventing componentization for its JVM called <a title="external Link: Jigsaw" href="http://blogs.sun.com/mr/entry/jigsaw" target="_blank">Jigsaw</a>. I hate to say it, but for me, it seems like Sun behaves like a small child trying to insist to be the one driving all development and not letting someone else play with its toys. It&#8217;s anything but the behavior of a well establish and industry leading company or one who wants to become one. First they completely ignored the problem of componentization in Java while persuing enterprise development with J(2)EE and missed their chance to actually set the foundation for real software reuse what you would expect from and enterprise ready language specification. Later, when OSGi began to rise they started the JSR 277 and tried to create a competing standard in secret, which didn&#8217;t work out too well as we all know. Now, because of the pressure of the community and the lack of showing a better solution they are abandoning the JSR and start developing their own &#8220;internal&#8221; componentization approach with the Jigsaw project. Of course they are claiming it is not intended to be used outside their own use case for componentizing the JVM, but it is hard for me to believe this. Call me paranoid, but for me it sounds much more like an attempt to develop another system, which after completion is suddenly moved into an official standard. Sun&#8217;s statement that they are going to revive JSR 294 and are inviting even the OSGi Alliance to participate to work on it feels more like a distraction so that Sun is able to pursue its plans with Jigsaw in private that without public notice they suddenly can come up with a self made de-facto standard. Again, I might be to paranoid, but it just doesn&#8217;t feel right. Is all that just a coincident? I don&#8217;t think so. Why can&#8217;t they embrace the work done already and see it as a great chance to propel their Language and create a true reusable software stack, no other vendor can offer? Hal Hildebrand just blogged about Sun&#8217;s attempt to introduce this new project and the way they are trying to persuade big industry players about their great intents&#8230; Well, you should really read his <a title="external link: Hal Hildebrands blog post" href="http://www.tensegrity.hellblazer.com/2008/12/spice-is-not-a-recreational-drug.html" target="_blank">post</a> about it and please tell me, if they have such humble goals, why does everyone they consult have to sign a NDA? I strongly believe that if those ideas are so great, why not share them and let the community decide and participate?</p>
<p>To wrap things up, I ask all of you who feel like me, share you&#8217;re opinion! Comment on Hal&#8217;s post, blog about it, link to it, spread the word. I believe we &#8211; as a community &#8211; have to stand up and say what we think to show Sun, that those kind of guerrilla tactics, especially when so easily to look through are not working. Keep your eyes open and don&#8217;t fall for the dark side <img src='http://osgi.mjahn.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Cheers,<br />
Mirko</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fosgi.mjahn.net%2F2008%2F12%2F04%2Fcomponentization-wars-part-ii-guerrilla-tactics%2F&amp;title=Componentization%20wars%20part%20II%20%E2%80%93%20Guerrilla%20tactics" id="wpa2a_8"><img src="http://osgi.mjahn.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://osgi.mjahn.net/2008/12/04/componentization-wars-part-ii-guerrilla-tactics/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Whole &#8211; More than the sum of all parts</title>
		<link>http://osgi.mjahn.net/2008/11/26/the-whole-more-than-the-sum-of-all-parts/</link>
		<comments>http://osgi.mjahn.net/2008/11/26/the-whole-more-than-the-sum-of-all-parts/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 17:43:03 +0000</pubDate>
		<dc:creator>Mirko Jahn</dc:creator>
				<category><![CDATA[Componentization]]></category>
		<category><![CDATA[JSR 291]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[library design]]></category>
		<category><![CDATA[reuse]]></category>
		<category><![CDATA[Spring DM]]></category>

		<guid isPermaLink="false">http://osgi.mjahn.net/?p=53</guid>
		<description><![CDATA[A lot of people are following the buzz about OSGi now and are excited about all the things it can do for you. A great world of new opportunities. Now, after the first draft of OSGi 4.2 it very much &#8230; <a href="http://osgi.mjahn.net/2008/11/26/the-whole-more-than-the-sum-of-all-parts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A lot of people are following the buzz about OSGi now and are excited about all the things it can do for you. A great world of new opportunities. Now, after the first draft of OSGi 4.2 it very much looks like we&#8217;re getting even more as an official OSGi standard (with RFC 124). The formally called Spring Dynamic Modules (in short SpringDM) is going to be OSGi-efied. Today, I want to take a short peak into what this can actually mean and how it could affect the software/ component reuse in your software stack even today.</p>
<p>First things first, when I talk to people about OSGi the most common complain is nothing OSGi specific at all. Basically it is the problem of every API out there. If you implement against an open or proprietary API you&#8217;re bound to it to some extend. Ok, this is besides the issue of being to complex. When done right, which includes using all the versioning features OSGi offers it is unfortunately kinda true. We&#8217;re still lacking the right tooling support here. Anyway, let&#8217;s stick to the first one first (I&#8217;ll cover the tooling problem in a later post).  Speaking of proprietary, it is true you have to add custom headers to your jar files, but this alone doesn&#8217;t hurt you. You can still just use the jar as &#8211; yeah well &#8211; a simple jar in your web container or any other Java application without any problems at all. This was simple, but there is more of course &#8211; the OSGi doesn&#8217;t only specify manifest headers. There is also an API you use and program against. Activators for instance can be used to do something like setting up or shutting down your bundle and opening or closing connection pools to databases, registering services signaling that you&#8217;re bundle is there and ready to get its work done. Assuming you are not using any of the compendium APIs the imposed layer is rather small and can be encapsulated in a single package per bundle and more often just one single class.</p>
<p>However, as soon as you start using those few classes they become part of your jar and thus you&#8217;re bound to them. So, we&#8217;re still stuck right?  Well, not really. First of all, every OSGi expert (and probably any other sane software engineer) will tell you not to intermingle your domain logic with middleware APIs of any kind. As already mentioned, with OSGi, you can usually keep this layer pretty thin. With Spring DM we can make it now even thinner and separate domain concerns from the container entirely. So, how can we achieve this. Of course, Spring is not doing any magic, although it does a pretty good job. All it does is actually providing an IoC framework, which declaratively wires beans together. Plain simple speaking, that&#8217;s about it. You could also use other IoC frameworks like Google Guice or pico container if like, but the integration in OSGi with Spring is pretty unique.  The big question remaining is how we can best separate these two concerns.</p>
<p>To start with, you design your domain logic in a bean driven way. By that you not only achieve a well testable domain code, you also remove hard wired dependencies not relevant for your core needs &#8211; a very common practice in Domain Driven Design, to throw in some buzz words <img src='http://osgi.mjahn.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Package all that code in one or more bundles depending on your needs. What you got is the code base you can reuse in any environment. Now, we need the glue code to actually make it work in OSGi &#8211; the package with the few OSGi specific classes. Those you now have to put into a different bundle or fragment (more on this later). By this separation you no longer deliver container specific code, if you don&#8217;t need to. Even more, depending on your deployment scenario, you can change and adjust the configuration to your specific needs, all separated in different bundles/fragments. Removing configurations from your domain bundles has the advantage of independent versioning of you actual code  and configuration. The domain code, if used f.i. in a Software Product Line is now no longer related to the configuration of your products based on this code and can be versioned independently &#8211; enabling you to see what really changes in your application.</p>
<figure id="attachment_60" aria-labelledby="figcaption_attachment_60" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-60" title="Application Architecture" src="http://osgi.mjahn.net/wp-content/uploads/2008/10/whole-moreasthesum-300x229.jpg" border="0" alt="Application Architecture" width="300" height="229" /><figcaption id="figcaption_attachment_60" class="wp-caption-text">Fig.1 - Sample Application Architecture</figcaption></figure>
<p>This approach is shown in figure 1. You have two applications using the same library with different configurations. You can fix bugs or add features in the library without touching the configurations and vice versa. Interesting now is the difference between fragments and bundles. When should I use what? The advantage of a bundle is that it is the way OSGi intends to deploy code. You can use Activators and define your dependencies. The fragment in contrast was actually intended to only carry optional data like i18n information and alike. The advantage however is that the fragment and its host are sharing the same class loader(, which is also the biggest disadvantage and should be considered really carefully!). This distinction basically sets when to use what. When ever the configuration is loaded by the library and can&#8217;t be injected by another bundle, you need to have access to the bundles class path in order to provide the required resource. But wait a minute, you can&#8217;t use Activators in fragments. How could we now do the initialization? Here Spring DM comes in. You can just provide a Spring configuration in your fragment and as soon as the fragment is attached, Spring will recognize it and just initializes your beans defined in the descriptor and you have your Activator again. You even have access to the BundleContext if required. However, this approach is only intended for code that otherwise wouldn&#8217;t work or can&#8217;t be changed for some reasons. The best way to do it is for sure using bundles for that kinda thing.</p>
<p>The main point, I was trying to make here is that with the help of Spring and the up coming manifestation in OSGi R4.2 (if accepted), we have even more opportunities to build reusable and coherent artifacts, perfect suitable for software product lines. However, all the presented possibilities also impose potential for misuse and you should be careful by choosing your way. In many cases the simplest way on first sight eventually becomes a dead end, so be careful and farsighted when making your decisions.</p>
<p>Cheers<br />
Mirko</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fosgi.mjahn.net%2F2008%2F11%2F26%2Fthe-whole-more-than-the-sum-of-all-parts%2F&amp;title=The%20Whole%20%E2%80%93%20More%20than%20the%20sum%20of%20all%20parts" id="wpa2a_10"><img src="http://osgi.mjahn.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://osgi.mjahn.net/2008/11/26/the-whole-more-than-the-sum-of-all-parts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSGi dynamics and legacy code &#8211; taming the beast in the future?</title>
		<link>http://osgi.mjahn.net/2008/10/28/osgi-dynamics-and-legacy-code-taming-the-beast-in-the-future/</link>
		<comments>http://osgi.mjahn.net/2008/10/28/osgi-dynamics-and-legacy-code-taming-the-beast-in-the-future/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 05:34:55 +0000</pubDate>
		<dc:creator>Mirko Jahn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JSR 291]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[architecture]]></category>

		<guid isPermaLink="false">http://osgi.mjahn.net/?p=61</guid>
		<description><![CDATA[Legacy code in OSGi has always been a problem. OSGi has such a dynamic nature, most libraries are either not aware of the potential errors that can be imposed by suddenly disappearing bundles or just use techniques not suitable for &#8230; <a href="http://osgi.mjahn.net/2008/10/28/osgi-dynamics-and-legacy-code-taming-the-beast-in-the-future/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Legacy code in OSGi has always been a problem. OSGi has such a dynamic nature, most libraries are either not aware of the potential errors that can be imposed by suddenly disappearing bundles or just use techniques not suitable for the OSGi programming model, like absolute paths, usage of file references instead of URLs, context class loaders and others alike. Despite these, I would call generally bad programing practices, which can be avoided even in non OSGi environments (maybe except the context class loader problem), there is one thing which is typical for regular applications and just doesn&#8217;t quite work within OSGi &#8211; static, implementation based APIs.</p>
<p>So, what do I mean with that. In short, the common APIs you are usually faced with when dealing with plain Java applications. You have a class which represents your API, you may have some configuration files to set your system up and that&#8217;s it &#8211; plain simple. Logging is a perfect example for that. Let&#8217;s take any of your preferred, non OSGi logging APIs. You have a configuration file or system properties, which set the basic configuration and then you are good to go. Just call a static factory, obtain you logging object and start what ever you wanna do with it.</p>
<p>Now, what is the problem with this in an OSGi context? At first glance, nothing. You can set-up your system and it behaves like in plain Java. Problems only occur when you start trying to use it in a dynamic, typical OSGi-way. Changing a configuration during run-time, providing the configuration in a different bundle or fragment will require you to take more things like the start order into account. This in return makes your bundles no longer following core principles of OSGi, which say that as soon as a bundle gets resolved, it can be used.</p>
<p>Solving this seems hard. You can&#8217;t change a public API. Not like usual, just extract interfaces and make the implementation available as a service. Well, in some cases this might be possible, sure it won&#8217;t be in all cases. Looking at this issue, what is the core problem? The export of the API packages! Assuming, you only depend on packages (not using Require-Bundle) bundles, depending on a certain API become resolved, as soon as this API becomes available as an exported package.</p>
<p>A possible solution to this dilemma is treating export packages like services. During run-time, a bundle can explicitly add or remove exported packages. With this, you would be able to only export a certain API when you are certain, it will work as expected. Of course, this needs more thinking, because this imposes several problems (Security is just one of them), but the potential is great. To be honest, I am currently not sure if it is worth the risk or even the effort, but I am definitely sure it is worth exploring. Just think of the possibility to actually eliminate the dynamic import header with all of its drawbacks and removing proprietary workarounds like buddy class loading. So, what do you think?</p>
<p>Cheers,<br />
Mirko</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fosgi.mjahn.net%2F2008%2F10%2F28%2Fosgi-dynamics-and-legacy-code-taming-the-beast-in-the-future%2F&amp;title=OSGi%20dynamics%20and%20legacy%20code%20%E2%80%93%20taming%20the%20beast%20in%20the%20future%3F" id="wpa2a_12"><img src="http://osgi.mjahn.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://osgi.mjahn.net/2008/10/28/osgi-dynamics-and-legacy-code-taming-the-beast-in-the-future/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some thought on the OSGi R4.2 early draft</title>
		<link>http://osgi.mjahn.net/2008/08/28/some-thought-on-the-osgi-r42-early-draft/</link>
		<comments>http://osgi.mjahn.net/2008/08/28/some-thought-on-the-osgi-r42-early-draft/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 22:00:21 +0000</pubDate>
		<dc:creator>Mirko Jahn</dc:creator>
				<category><![CDATA[JSR 291]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Specifications]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[draft]]></category>
		<category><![CDATA[specification]]></category>

		<guid isPermaLink="false">http://osgi.mjahn.net/?p=40</guid>
		<description><![CDATA[Last week the OSGi website[1] published the early draft of the OSGi R4.2 specification[2]. Reason enough to have a short look at what is covered in the upcoming release. First of all one has to notice that this is not &#8230; <a href="http://osgi.mjahn.net/2008/08/28/some-thought-on-the-osgi-r42-early-draft/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last week the OSGi website<a href="#ref">[1]</a> published the early draft of the OSGi R4.2 specification<a href="#ref">[2]</a>. Reason enough to have a short look at what is covered in the upcoming release.</p>
<p>First of all one has to notice that this is not a minor release as the version number may suggest. Release 4.2 is actually way more significant than the R4.1 release last year. At some points I would even say it is more important than the R4 release, because with that one usage becomes way more easier, especially for none OSGi experts. But first things first. What is actually in the new draft?</p>
<p>Core design changes/ enhancements:<br />
RFC 120 &#8211; Security Enhancements<br />
RFC 121 &#8211; Bundle Tracker<br />
RFC 125 &#8211; Bundle License<br />
RFC 126 &#8211; Service Registry Hooks<br />
RFC 128 &#8211; Accessing Exit Values from Applications<br />
RFC 129 &#8211; Initial Provisioning Update<br />
RFC 132 &#8211; Command Line Interface and Launching<br />
RFC 134 &#8211; Declarative Services Update</p>
<p>Enterprise design changes:<br />
RFC 98   &#8211; Transactions in OSGi<br />
RFC 119 &#8211; Distributed OSGi<br />
RFC 124 &#8211; A Component Model for OSGi</p>
<p>Covering all of these RFCs in this post won&#8217;t be possible, but I want to pick some of them and go a little bit into the details.</p>
<p><strong>RFC 120 &#8211; Security Enhancements (P. 5)</strong><br />
The major change here is the introduction of the concept of a black list. Now, you are able to say something like everyone is allowed to do such and such, unless&#8230; and here comes the clause. Before, only white lists were possible. Although, this is a tremendous improvements in terms of simplicity, there is a reason why black lists are not as secure as white lists and why certain systems don&#8217;t implement black list approaches. I think this feature should be treated with extreme caution and I hope this won&#8217;t hunt back the OSGi, when security flaws based on this are surfacing, which will most certainly will.</p>
<p><strong>RFC 125 &#8211; Bundle License (P. 62)</strong><br />
Licenses are always a problem in Software development. Especially when a lot of 3rd party libraries are involved. The OSGi now addresses these issues by defining a header for the manifest, which conforms to a distinct syntax, which subsequently allows vendors to not only express the kind of license a certain bundle is published, but also which portion of the code is associated with what license within a bundle. In my opinion, this is a really cool feature. Conceptually certainly not rocket science, but the benefits are many folded. Now, it is possible to display, which licenses are actually contained in your container and even more important, you can define rules for certain Licenses not being deployed in your environment. I am just thinking on the typical viral problem of GPL<a href="#ref">[3]</a> like licenses.</p>
<p><strong>RFC 126 &#8211; Service Registry Hooks (P. 71)</strong><br />
This is going to be a mechanism, mainly used for framework related services and not applications in general. The idea is to allow hooks, to tweak the service registry behavior. One very likely use case are remote services, as discussed for quite a while in the OSGi community. Although very useful and powerful, I can see the problem that you get indirect dependencies with this one and eventually have similar problems like with plain java jar files. A bundle doesn&#8217;t express which tweaked service manipulation it needs (similar to the &#8220;which jar also needs to be at what pssition in your class path&#8221; problem). Of course, this is not the aim of the spec, but as soon as it is possible, people start using it, even if it is not intended by the designers. Fragments are the most famous example for this pattern.</p>
<p><strong>RFC 129 &#8211; Initial Provisioning Update (P. 97)</strong><br />
The initial provisioning specification as published in the R4.1 spec has a major drawback. It assumes, that the created jar can be manipulated in terms of setting properties to the zipped content (information about the MIME type). Although, this can easily be done in Java, all major build tools I know of are lacking this feature, so custom implementations had to be used instead. A reason, why I once chose not to go with this solution. This is now addressed in the RFC. A very useful update, if you ask me.</p>
<p><strong>RFC 132 &#8211; Command Line Interface and Launching (P. 103)</strong><br />
Till now, all OSGi implementations differed in the way they were started and one could extend the console. This will change with this new RFC. For me this is the right direction. We really need clear interfaces to instrument the container, so that exchanging the container becomes easier. Of course, every framework provider will still have it&#8217;s own &#8220;enhanced&#8221; features, which is a good thing, but you easier avoid the typical lock in. This should boost transparency between frameworks.</p>
<p><strong>RFC 134 &#8211; Declarative Services Update (P. 144)</strong><br />
I haven&#8217;t looked very close into that, because Spring (as well as iPOJO<a href="#ref">[4]</a> or SAT<a href="#ref">[5]</a>) are way superior and wider used than DS, but in general, the reliability of obtaining a service was increased. Some oddities have also been removed/solved.</p>
<p><strong>RFC 98 &#8211; Transactions in OSGi (P. 154)</strong><br />
Transaction are being introduced to provide a true ACID level support. For this the JTA is going to be used. Additionally the Distributed Transaction Processing (XA+ Specification Version 2, The Open Group, ISBN: 1-85912-046-6) protocol will be used, which is specifically tailored to meet OSGi&#8217;s needs. I haven&#8217;t dug really deep into this, but I hope with this RFC the issues user have reported with libraries like Hibernate will finally be solved. An issue popping up quite often.</p>
<p><strong>RFC 119 &#8211; Distributed OSGi (P. 169)</strong><br />
The goal should be clear, but here is a citation taken from the spec:</p>
<ul>
<li> <em>An OSGi bundle deployed in a JVM to invoke a service in another JVM, potentially on a remote computer accessed via a network protocol</em></li>
<li><em>An OSGi bundle deployed in a JVM to invoke a service (or object, procedure, etc.) in another address space, potentially on a remote computer, in a non OSGi environment )</em></li>
<li><em>An OSGi service deployed in another JVM, potentially on a remote computer, to find and access afrom remote OSGi bundle</em> service running in the &#8220;local&#8221; OSGi JVM (i.e. an OSGi deployment can accept service invocations</li>
<li><em>A program deployed in a non OSGi environment to find and access a service running in the &#8220;local&#8221;</em> OSGi JVM (i.e. an OSGi deployment can accept service invocations from external environments)</li>
</ul>
<p>[OSGi Spec R4.2 early draft (P.174) - August 22th, 2008]</p>
<p>I really like the idea of being able to use services from other JVM and even other machines, without having to worry about how to implement this. A very compelling idea! Unfortunately I don&#8217;t believe in a flat world and so I don&#8217;t believe in such a simple solution. Network connections tend to have a latency, drop unexpected or even return corrupted data. If your service consumer is not agnostic of that, I think there will be more and more problems popping up. However, I am open for this and will watch the development closely. Eric Newcomer<a href="#ref">[6]</a> gave a pretty impressive demo how this works at the OSGi Community Event<a href="#ref">[7]</a>, so I am looking forward to get my hands dirty. Call me idealistic, but I actually want this to work and prove me wrong!</p>
<p><strong>RFC 124 &#8211; A Component Model for OSGi (P. 216)</strong><br />
The most important change however is described in RFC 124 in my opinion. Here, the former known Spring DM<a href="#ref">[8]</a> approach is translated into an OSGi standard. After a first quick look, it seems like it is indeed the Spring DM specification OSGi&#8217;ified topped with some additional semantic sugar, but I have to look closer to be sure. The only question which remains for me is, if this RFC will really make it into the final spec, what will happen with DS? In my opinion, RFC 124 is way superior to DS and there are no good reasons to keep DS. If I am wrong, maybe someone can shed some light.</p>
<p><strong>Conclusion</strong><br />
Besides the facts mentioned in the early draft, I find particular interesting, what actually didn&#8217;t made it into the early draft. For me the whole EE issue with the mapping of web.xml&#8217;s for instance is completely missing. The enterprise features are the things I was eager to read, but instead total silence. Hopefully they are still working on it. Releasing the next version of OSGi without the a convincing Java EE story is like driving a car with the handbreak on. Let&#8217;s hope the EEG will manage to finalize theirs EE story in time!</p>
<p>As I final note I want to say, that I think it is a great move from the OSGi alliance to actually grant early access to the things they are working on. This makes it way more transparent for the community, what is going on behind the closed doors of the specification process of the OSGi. Maybe in the furture, we&#8217;ll see an open way of interacting with the whole JSR process, so that even Sun will eventually be satisfied. Well, time will tell&#8230;</p>
<p>Cheers,<br />
Mirko</p>
<p>&#8211;</p>
<div id="ref">References:</div>
<p>[1] OSGi Homepage: <a title="external: OSGi Hompage" href="http://www.osgi.org/Main/HomePage" target="_blank">http://www.osgi.org/Main/HomePage</a><br />
[2] OSGi R4.2 early draft: <a title="external: OSGi R4.2 early draft (pdf)" href="http://www.osgi.org/download/osgi-4.2-early-draft.pdf" target="_blank">http://www.osgi.org/download/osgi-4.2-early-draft.pdf</a><br />
[3] GPL License: <a title="external: GPL v3" href="http://www.opensource.org/licenses/gpl-3.0.html" target="_blank">http://www.opensource.org/licenses/gpl-3.0.html</a><br />
[4] iPOJO: <a title="external: Apache iPOJO" href="http://felix.apache.org/site/ipojo.html" target="_blank">http://felix.apache.org/site/ipojo.html</a><br />
[5] SAT: <a title="external: SAT" href="http://www.vanderleiindustries.com/sat/help/topic/org.eclipse.soda.sat.plugin.doc/books/book.html" target="_blank">http://www.vanderleiindustries.com/sat/help/topic/org.eclipse.soda.sat.plugin.doc/books/book.html</a><br />
[6] Eric Newcomer&#8217;s blog: <a title="external: Eric Newcomers Blog" href="http://blogs.iona.com/newcomer" target="_blank">http://blogs.iona.com/newcomer</a><br />
[7] OSGi Community Event: <a title="external: OSGi Community Event Homepage" href="http://www.osgi.org/CommunityEvent2008/HomePage" target="_blank">http://www.osgi.org/CommunityEvent2008/HomePage</a><br />
[8] Spring DM: <a title="external: Spring DM" href="http://www.springframework.org/osgi" target="_blank">http://www.springframework.org/osgi</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fosgi.mjahn.net%2F2008%2F08%2F28%2Fsome-thought-on-the-osgi-r42-early-draft%2F&amp;title=Some%20thought%20on%20the%20OSGi%20R4.2%20early%20draft" id="wpa2a_14"><img src="http://osgi.mjahn.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://osgi.mjahn.net/2008/08/28/some-thought-on-the-osgi-r42-early-draft/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>The notion of an application: Fitting just in</title>
		<link>http://osgi.mjahn.net/2008/07/21/the-notion-of-an-application-fitting-just-in/</link>
		<comments>http://osgi.mjahn.net/2008/07/21/the-notion-of-an-application-fitting-just-in/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 21:32:58 +0000</pubDate>
		<dc:creator>Mirko Jahn</dc:creator>
				<category><![CDATA[JSR 291]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Componentization]]></category>
		<category><![CDATA[domain definition]]></category>
		<category><![CDATA[modul]]></category>

		<guid isPermaLink="false">http://osgi.mjahn.net/?p=36</guid>
		<description><![CDATA[I was actually planing on writing something about this topic for months now, but I never found time to do so. Now that Peter Kriens picked up the topic in his current post [1], I just felt the need to &#8230; <a href="http://osgi.mjahn.net/2008/07/21/the-notion-of-an-application-fitting-just-in/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was actually planing on writing something about this topic for months now, but I never found time to do so. Now that Peter Kriens picked up the topic in his current post <a href="#ref">[1]</a>, I just felt the need to write about my thoughts on this issue.</p>
<p><strong>What is it all about?<br />
</strong></p>
<p>When working on computer programs for a while, you pretty soon realize that you don&#8217;t want to invent the wheel all over again. So, people came up with concepts driving software reuse further and further. Starting from functional programming, finding its way to the fine world of objects and in our days driving more and more towards component based programming. Nothing surprising &#8211; though. With the help of OSGi I&#8217;d like to say Java has a pretty good standing among its competitors and could already be considered component ready.</p>
<p>However, there is one problem, at least as far as I am concerned. Looking at software product lines (I know, I know, they are more considered a fancy dream than a real world solution, but please hang in there for a moment and let me explain) the core concept &#8211; as I would call it &#8211; is the idea of divide and conquer. In a complex domain as computer science, it is not feasible to believe one can manage everything down to the finest granularity. So what you end up doing is creating the big picture and drill down on a &#8220;as needed&#8221; basis &#8211; a typical top down approach. Of course, this assumes you already have your main building blocks to work with. OSGi by its nature in general supports you in doing so. You only pick your functionality in terms of simple bundles and throw them into an OSGi container and everything just works &#8211; well, almost.</p>
<p>Unfortunately, that&#8217;s just the simplest scenario when things like this are working. Peter is saying in his blog that applications (bundles belonging to one domain and providing a certain functionality with their collective interaction, as I would define it) are simple to manage, because they express their dependencies. Tools like the OBR<a href="#ref">[2]</a> make installation issues disappear and all the remaining requirements for an &#8220;application&#8221; concept to solve their problems are actually derived f.i. from the use of Class.forName() in legacy code to extend their applications and the sharing of implementation classes rather than interfaces. Here I have to disagree. Of course, the whole Class.forName() ideology is a problem within OSGi, but I don&#8217;t think this is the major reason for the demand for an application model.</p>
<p><strong>Why is the concept of an application worth while?</strong></p>
<p><a href="http://osgi.mjahn.net/wp-content/uploads/2008/07/appgrouping_appstack.jpg"><img class="alignleft size-medium wp-image-37" style="border-width: 0px;" title="Figure 1 - Sample Application Stack" src="http://osgi.mjahn.net/wp-content/uploads/2008/07/appgrouping_appstack-300x181.jpg" alt="Figure 1 - Sample Application Stack" width="300" height="181" /></a>Let&#8217;s assume you&#8217;re building a pretty complex application with &#8230; 400+ different bundles or so. Referring to  software product line design you&#8217;re no longer managing all of these bundles, but you&#8217;re managing some sort of an application stack. If your interested in (see figure 1) creating a new application with &#8220;Domain Logic 1&#8243; and &#8220;Domain Logic 3&#8243;, you just pick those and all the underlying plumbing should be taken as well. Of course (and  here it becomes tricky) this involves loose coupling, which doesn&#8217;t include dependencies on a specific implementation or even worse implementer on the domain logic stack. Everything is abstracted from the implementation and everything just depends on interfaces and services.</p>
<p><a href="http://osgi.mjahn.net/wp-content/uploads/2008/07/appgrouping_appdependencyprob.jpg"><img class="alignleft size-medium wp-image-38" style="border-width: 0px;" title="Figure 2 - Dependency path problem with separated API and implementation" src="http://osgi.mjahn.net/wp-content/uploads/2008/07/appgrouping_appdependencyprob-300x232.jpg" alt="Figure 2 - Dependency path problem with separated API and implementation" width="300" height="232" /></a>One of my core problem here is that there is no distinct bundle representing an application. There is no syntax, convention, anything. I need to know which bundle in the application is my &#8220;core&#8221; (and I am not even talking about finding out, what my applications are, I can choose from). Having figured out which one to use, we are still not in a safe harbor. The problem continues with the separation of API and implementation. Ones both are separated by design (as shown in figure 2), I can happily resolve all my bundles, but nothing works, when solely relying on Package-Import statement scoping (which I &#8211; again! &#8211; highly recommend). Automatic tools dependency discovery tools just can&#8217;t find a path to the implementation. In figure 2 you can see the problem show by the arrow. Starting from the &#8220;Core Bundle&#8221;, I only have a dependency on the API. The API doesn&#8217;t have any dependency on the implementation. The Implementation bundle does have a dependency on the API, but for the dependency resolution tool, it is not clear, if the bundle is just using the API or implementing it.</p>
<p>As you now see, there is a certain problem and I wasn&#8217;t actually surprised when I heard about Springs approach to this problem. Although Springs way is a fast solution for the immanent problem, it introduces dependencies one might not want. Bundling components together in the Spring way ties the interface to the implementation, limiting the flexibility of the whole design.</p>
<p><strong>So, basically we are doomed, right?</strong></p>
<p>Well, the question is, what do we REALLY need. As I mentioned before, in my opinion, it is a set of just a few features:</p>
<ol>
<li>an application identifier (this is great to figure out what functionality I actually have)</li>
<li>a way to express simple dependencies (with Import-Package, I think we pretty much have that)</li>
<li>some way to express dependencies on our environment, like the existence of a certain service implementation.</li>
</ol>
<p>Looking closely at the core spec, we can actually find almost everything we need. Unfortunately, we can&#8217;t use this right away. Feature number one for instance can very easily be achieved by just introducing a new property in the Manifest.mf file &#8211; even a version can be introduced, although I am not sure this is a good idea yet.</p>
<p>The tricky part comes with feature number 3. Looking at the latest official OSGi core spec version 4.1, there is no meta data concept reflecting services*. Fortunately, there are still the old specs available for download <a href="#ref">[3]</a> and here we can find in version 3 the &#8220;Export-Service&#8221; and &#8220;Import-Service&#8221; headers removed from the current specification. Assuming all bundles are correctly tagged with the right meta data, tools like the OBR can easily create a dependency tree and figure out which bundles to pick. Even better, such tools are now able to pick the best implementation based on their other dependencies and potential version conflicts on the imports of each implementation bundle. I think such a dynamic solution is way better fitting the OSGi way of doing things than any static one.</p>
<p>Ok, I know R3 is so &#8220;old school&#8221; and we are living in a brave new world. Swimming back is not an option in a buzz, hype and in general fast pace driven world. Fortunately, we don&#8217;t have to. With Spring DM <a href="#ref">[4]</a>, there is a way to express dependencies on services in a declarative way. Here you can define which services you are consuming and which ones you are providing, thus giving 3rd party tools the ability to analyze the dependencies way more subtle. If the Spring DM approach is used widely &#8211; as a new &#8220;official&#8221; standard, tools like OBR can now work again. They are able to assemble the right product configuration and deploy a runnable application based on the additional meta data from the Spring DM configuration. The only drawback so far, only if everyone is using this configuration, we will get the best results. If partially used, the results may not be providing any significant improvement based on the very bundle constellation.</p>
<p>Something I intentionally left out till now is the new idea of providing nested frameworks. I haven&#8217;t thought that entirely through though, I have to admit. In general I like the idea, but for other reasons. The main reason, why I don&#8217;t like it for this particular problem of the lack of the notion of applications is that when looking at figure 1, you might end up with several layers of applications, which would then ultimately end-up in requiring multiple layer nesting of frameworks. And speaking about complexity I am not sure, if a framework in a framework in a framework in a &#8230;. makes life so much easier. Besides, this still doesn&#8217;t solve the problem with discovering the necessary dependencies for an application &#8211; not counting manually configuration of such a sub framework of course.</p>
<p><strong>Conclusion</strong></p>
<p>For me there is a clear need for an application like notion in OSGi. As shown above, there are valid use cases even now, which make the use of OSGi kind of limited in the long run. However, I actually don&#8217;t see the need for an entirely new concept, above or beyond a bundle. The only thing we really need is a clear statement, how to provide and obtain the required information to do the described extended dependency analysis. With these information at hand, tools by 3rd parties can be developed and make us all equally happy. At the end, we should keep in mind that OSGi is (currently) about defining a component standard, which should be open and not enforcing any lock in. This is in contrast to most of the adapters wishes of having a simple technology, solving their immanent problems. I think, now there is time for great tools to support working with OSGi more easily, helping developer to adapt and embrase the functionality and freedom offered by OSGi.</p>
<p>Cheers,<br />
Mirko</p>
<p>*) actually I was cheating a little bit here. OSGi R4 compendium contains the Declarative Service (DS) definition, which in fact defines valuable meta data. The reason, why I didn&#8217;t mention it here is basically related to the fact that Spring DM is superior to DS in many ways and DS is not part of the core specification, so I favored Spring DM for the sake of functionality.<br />
&#8211;</p>
<div id="ref">References:</div>
<p>[1] OSGi Blog: <a title="external: OSGi Blog" href="http://www.osgi.org/blog/2008/07/osgi-application-grouping.html" target="_blank">http://www.osgi.org/blog/2008/07/osgi-application-grouping.html</a><br />
[2] OBR: <a title="external: OSGi Bundle Repository" href="http://www.osgi.org/Repository" target="_blank">www.osgi.org/Repository</a><br />
[3] OSGi Spec Download Site: <a title="external: OSGi Spec Download Site" href="http://www.osgi.org/Specifications/HomePage" target="_blank">http://www.osgi.org/Specifications/HomePage</a><br />
[4] Spring DM: <a title="external: Spring DM Homepage" href="http://www.springframework.org/osgi" target="_blank">http://www.springframework.org/osgi</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fosgi.mjahn.net%2F2008%2F07%2F21%2Fthe-notion-of-an-application-fitting-just-in%2F&amp;title=The%20notion%20of%20an%20application%3A%20Fitting%20just%20in" id="wpa2a_16"><img src="http://osgi.mjahn.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://osgi.mjahn.net/2008/07/21/the-notion-of-an-application-fitting-just-in/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A little bit of talking at the OSGi Community Event</title>
		<link>http://osgi.mjahn.net/2008/06/03/a-little-bit-of-talking-at-the-osgi-community-event/</link>
		<comments>http://osgi.mjahn.net/2008/06/03/a-little-bit-of-talking-at-the-osgi-community-event/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 07:10:26 +0000</pubDate>
		<dc:creator>Mirko Jahn</dc:creator>
				<category><![CDATA[JSR 291]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Componentization]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://osgi.mjahn.net/?p=29</guid>
		<description><![CDATA[Two weeks ago I received great news. The proposal I committed with my fellow coworkers (Boris Terzic and Markus Gumbel) got accepted at the OSGi community event, so I hope I&#8217;ll see some of you I only met virtually till &#8230; <a href="http://osgi.mjahn.net/2008/06/03/a-little-bit-of-talking-at-the-osgi-community-event/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Two weeks ago I received great news. The proposal I committed with my fellow coworkers (Boris Terzic and Markus Gumbel) got accepted at the OSGi community event, so I hope I&#8217;ll see some of you I only met virtually till now. Concerning the topic &#8211; I think it&#8217;ll be interesting for all of you working or at least intending to work with security and OSGi. Now, after I am allowed to talk about it, I will be able to share some of the experiences we gained.</p>
<p>In the talk titled &#8220;Do not disturb my circles! Secure Application Isolation with OSGi&#8221;<a href="#ref">[1]</a>, Markus Gumbel<a href="#ref">[2]</a>, and I are going to talk about how to isolate several application domains within one JVM &#8211; based on OSGi mechanisms. No big deal, some of you might say, but depending on your requirements, it actually might become a big deal or even serious issue. In our very case, we will face a Common Criteria(CC)<a href="#ref">[3]</a>, evaluation for our JVM based components (<a href="#ref">[4]</a>, gives a nice introduction on this topic &#8211; unfortunately only in German). But first things first&#8230;</p>
<p>InterComponentWare AG (ICW)<a href="#ref">[5]</a>,, the company I am working for right now, is one of the (if not the) leading eHealth provider in the business, with a wide ranging product portfolio. The core product is called LifeSensor<a href="#ref">[6]</a>,, which is an electronic health record like Google<a href="#ref">[7]</a>, and Microsoft<a href="#ref">[8]</a>, introduced recently in their first versions. If you, like me, are a little paranoid about privacy issues, I can recommend you &#8220;our&#8221; service for sure. We take security pretty serious and have a whole department dedicated to this. Medical data are always a big issue. Consider your CreditCard data is lost, you can get reimbursed from your CreditCard company, once the access to your medical data is compromised, it can&#8217;t be undone. Pretty serious from my point of view! Anyway, this is actually not where I am aiming at. We (and my group in particular) are involved in the implementation of the German Telematic  Infrastructure project specified by the Gematik<a href="#ref">[9]</a>, and commissioned by the German government.</p>
<p>In our talk, we will take the &#8220;Konnektor&#8221; we are developing as the sample application to illustrate the usage of the OSGi security features. The Konnektor (we use the Cisco AXP platform<a href="#ref">[10]</a>, underneath) is the key device deployed at every medical practice and pharmacy. It is responsible for creating secure connections to the telematic infrastructure back end, as well as other security relevant tasks like reading eHealthCards, signing prescriptions or uploading emergency data on the electronicHealthCards for instance. <a href="#ref">[11]</a>, gives a nice overview, how things are done in more detail. Additionally the specification allows to have third party applications to be deployed on the connector as well, to extend its functionality. A concrete example would be the integration of the LifeSenor mentioned above to directly upload your X-Ray images to your eHealthRecord.  You might understand, that security plays a very important role in such a scenario.</p>
<p>The key problem we are faced with is that the functionality of the Konnektor has to be certified according to the CC, which I mentioned at the beginning of this post. Well, certifying software in general is not easy, especially if you are talking about security and something as complex as we have. The real problem in our case however is not certifying that the software does exactly the stuff specified &#8211; no more, no less -, but also allowing third party &#8220;plug-ins&#8221; to extend its features without compromising its certified functionality or the security of the whole system. In a simple scenario, a doctor uploads a new &#8220;feature&#8221; from a malicious source to the Konnektor and we have to ensure beforehand that nothing serious can happen &#8211; tough one! Well, of course, we not only found a way, but also found a way using OSGi&#8217;s security features to do the trick even within the same JVM. The Konnektor and potentially dangerous third party extensions running side by side in the same JVM (of course, without restarting &#8211; there is a reason why we are using OSGi!).</p>
<p>Like every other cutting edge software project, we also found ourselves struggling with various problems no one has experience before and so I am pretty sure, we can contribute some important insights in the domain of secure OSGi application development.  I hope this will be as interesting for you as it is for me to work on this topic. It is really something you can&#8217;t find a lot published about, if someone has done something similar or knows about something, I would be happy to hear about it!</p>
<p>Although, the sample we chose is pretty unique domain wise, the basic techniques we will present are applicable in many different domains as well (banking, insurance, development, personal live style,&#8230;). Just think of your Eclipse installation. Right now, you install your plug-ins without a SecurityManager and hope that the plug-in only does what it is supposed to do&#8230; What if it doesn&#8217;t &#8211; or better doesn&#8217;t intend to play by the rules? I can see OSGi frameworks running as general platforms combining various different application in one JVM in the furture &#8211; a kind of a meta Operating System. As soon as this vision becomes reality, I don&#8217;t want applications being able to communicate without restrictions with each other. My health insurance provider together with my personal medical record manager in one container&#8230; you never know what an insurer might do, when they get a hold of your sensitive medical records. At least I certainly don&#8217;t want to try this out!</p>
<p>I realize that parts of this post might sound like a commercial. If so, this is certainly not intended, but I felt the need to explain in more detail than I will be able at the talk, why we did what we did and why this is so important. In the talk, we will stick to the technology only and avoid as much as possible any relation to a concrete product &#8211; I really hate talks pretending to point out new technologies or lessons learned, but actually trying to sell a product instead, so you&#8217;re safe here for sure!</p>
<p>For those of you attending the conference, don&#8217;t hesitate to talk to me, if you have any questions or just say hello. I was and certainly am a big fan of technical discussions. All of you who won&#8217;t be able to attend the event and interested in the topic, don&#8217;t worry, after the talk, I am certainly blogging more about this topic in the near future <img src='http://osgi.mjahn.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Till then, stay tuned!</p>
<p><a href="http://osgi.mjahn.net/wp-content/uploads/2008/05/ce08speakerlogo_finalsm.png"><img class="alignright size-full wp-image-30" title="ce08speakerlogo_finalsm" src="http://osgi.mjahn.net/wp-content/uploads/2008/05/ce08speakerlogo_finalsm.png" alt="" width="225" height="91" /></a></p>
<p>Cheers,<br />
Mirko</p>
<p><span style="color: #ff0000;">UPDATE:</span> the slides can be downloaded from the OSGi Website for everyone interested (<a title="external: pdf with the presentation slides" href="http://www.osgi.org/wiki/uploads/CommunityEvent2008/24_JahnGumbel.pdf" target="_blank">pdf</a>)</p>
<p>&#8211;</p>
<div id="ref">References:</div>
<p>[1] <a title="external: OSGi Community Event - Program" href="http://www.osgi.org/CommunityEvent/Program" target="_blank">http://www.osgi.org/CommunityEvent/Program</a><br />
[2] <a title="external: Speaker Dr. Markus Gumbel" href="http://www.osgi.org/CommunityEvent/Speakers#MG" target="_blank">http://www.osgi.org/CommunityEvent/Speakers#MG</a><br />
[3] <a title="external: Common Criteria Website" href="http://www.commoncriteriaportal.org" target="_blank">http://www.commoncriteriaportal.org<br />
</a>[4] <a title="external: BSI website about the Common Criteria (German)" href="http://www.bsi.bund.de/cc/" target="_blank">http://www.bsi.bund.de/cc/</a><br />
[5] <a title="external: InterComponentWare Website" href="http://www.icw-global.com" target="_blank">http://www.icw-global.com</a><br />
[6] <a title="external: LifeSensor Website" href="https://www.lifesensor.com" target="_blank">https://www.lifesensor.com</a><br />
[7] <a title="external: GoogleHealth" href="http://www.google.com/health" target="_blank">http://www.google.com/health</a><br />
[8] <a title="external: Microsofts HealthVault website" href="http://www.healthvault.com/" target="_blank">http://www.healthvault.com</a><br />
[9] <a title="external: Gematik website" href="http://www.gematik.de" target="_blank">http://www.gematik.de</a><br />
[10] <a title="external: Cisco AXP router" href="http://www.cisco.com/en/US/prod/routers/ps9701/axp_promo.html" target="_blank">http://www.cisco.com/en/US/prod/routers/ps9701/axp_promo.html</a><br />
[11] <a title="external: Cisco AXP with the ICW Box" href="http://www.cisco.com/en/US/prod/collateral/routers/ps9701/data_sheet_c02_459078.html" target="_blank">http://www.cisco.com/en/US/prod/collateral/routers/ps9701/data_sheet_c02_459078.html</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fosgi.mjahn.net%2F2008%2F06%2F03%2Fa-little-bit-of-talking-at-the-osgi-community-event%2F&amp;title=A%20little%20bit%20of%20talking%20at%20the%20OSGi%20Community%20Event" id="wpa2a_18"><img src="http://osgi.mjahn.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://osgi.mjahn.net/2008/06/03/a-little-bit-of-talking-at-the-osgi-community-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SpringSource Application Platform &#8211; the next step forward for OSGi?</title>
		<link>http://osgi.mjahn.net/2008/05/26/springsource-application-platform-the-next-step-forward-for-osgi/</link>
		<comments>http://osgi.mjahn.net/2008/05/26/springsource-application-platform-the-next-step-forward-for-osgi/#comments</comments>
		<pubDate>Mon, 26 May 2008 18:23:48 +0000</pubDate>
		<dc:creator>Mirko Jahn</dc:creator>
				<category><![CDATA[JSR 291]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[Componentization]]></category>
		<category><![CDATA[platform]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://osgi.mjahn.net/?p=27</guid>
		<description><![CDATA[At the beginning of this month[1], SpringSource published the first beta release of their so called SpringSource Application Platform[2], an (as I would call it) extension of the existing OSGi platform. The move came pretty surprising to me, I have &#8230; <a href="http://osgi.mjahn.net/2008/05/26/springsource-application-platform-the-next-step-forward-for-osgi/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At the beginning of this month<a href="#ref">[1]</a>, SpringSource published the first beta release of their so called SpringSource Application Platform<a href="#ref">[2]</a>, an (as I would call it) extension of the existing OSGi platform. The move came pretty surprising to me, I have to admit. No announcements prior to the release, no actual hints &#8211; nothing. Pretty impressive I have to admit. A company grown that popular being able to work on something from this magnitude without even seeding the glimpse of a rumor. Good job.</p>
<p>Well, I guess eventually the guys behind Spring are trying to make money. A very natural thing for a company, of course. After having provided the community with a great framework for so many &#8220;supposed to be&#8221; JEE applications for free, it is time to gain some revenue. I think they deserve it after all they have done for the community. Actually I find it in particular interesting how the strategic move, choosing GPL<a href="#ref">[3]</a> as the license of choice, will work out. On the one hand, I can totally understand the point of view, choosing a license, which forces competitors to play with open cards and actually contribute to the community. On the other hand, I have to say, I am thinking twice before putting me in the hassle of dealing with a viral license. For instance, when I lately was involved in the decision between LOGBack<a href="#ref">[4]</a> and Log4j<a href="#ref">[5]</a> as a logging back end, the decision was not only based on features, but mostly licenses. In some scenarios, licenses are just a show stopper, so I honestly hope this will not be the case for my fellow colleagues from SpringSource.</p>
<p>Enough philosophizing&#8230; Spring released a very interesting extension to the existing OSGi specification. Summarizing all the new features they provide would certainly go beyond the scope of this blog, besides I am by far not as knowledgeable as the developers themselves, so I will just refer to their great introductions <a href="#ref">[6]</a>,<a href="#ref">[7]</a> and <a href="#ref">[8]</a>. Instead I want to point out some things I consider worth mentioning.</p>
<p>First of all, the repository<a href="#ref">[9]</a> is just great. With the experiences I&#8217;ve made by migrating existing applications into modular, OSGi based bundles, I can tell this can be pretty time consuming and frustrating, if done accurately (not just adding some headers to the <em>manifest.mf</em>, but also changing the existing code to work within OSGi where necessary).</p>
<p>The second thing I&#8217;d like to mention is two sided&#8230; On the one side, OSGi is missing another abstraction layer, I think. Defining full functional, domain modules to help people jump start in OSGi is needed &#8211; no getting lost in dozens of bundles, versions and services. I think all of you, working with OSGi for a while, have been faced with the problem, where you resolved and started every bundle appropriately, but your program will just not work, because you forgot to deploy the actual implementation of a service. Knowing your system, it won&#8217;t be a big thing finding the problem, but in a unfamiliar application with hundreds of bundles deployed and more potentially ready to be deployed from a repository, just waiting to be picked&#8230; which one is the one to choose? An abstraction &#8211; bundling those, as Spring has done it with its PAR &#8211; might help.</p>
<p>But, there is also another side to this story. Maybe all we need is some sort of indicator, a meta data to indicate, that a specific bundle provides/ consumes a distinct service? This will remove the provider lock-in problem caused by solutions like &#8220;Require-Bundle&#8221; for instance. All we actually need is a (in some way) abstract concept of a working entity (or application or domain module as you might prefer calling it), which is more abstract than usual bundles. This can just be the aggregation of certain packages and service consumers as well as providers. Only APIs, no actual implementation dependencies and for sure no Bundle-SymbolicName dependencies. An ideal application now would only consist of a couple of domain modules, which have to be deployed in the OSGi container. The container (with the help of the repository) now just picks the required bundles and assembles the application. No need to define a specific vendor, everything will be resolved by the framework. That would be my dream&#8230;</p>
<p>Anyway, I think this is something, which should be discussed in more detail in official sources. The approach Spring choose is certainly a way to go and test drive, but honestly, I doubt that it&#8217;ll turn out to be the right fit in the long run. All solutions I can think of, which were created to solve a certain pain are a serious burden and actual blocker in the long run, like Eclipse Buddy Class Loading, the OSGi Require-Bundle* header or the (unlimited) backwards compatibility required by the jar specification.</p>
<p>The last thing to mention is the introduction of the new headers. In general, I am all in favor of doing so and I am not surprised about the chosen names. Of course, they might clash with later headers, potentially introduced by the OSGi Consortium, but this is nothing new in Java. If you take a look around, developers as it seams, consider the reverse domain nomenclature as a burden and just ignore it. Even if it is now better established on a package level (although there are still rather well known exceptions like the IAIK<a href="#ref">[10]</a> or even Peter Kriens FileInstall<a href="#ref">[11]</a> bundle for instance). On a Manifest level however most of us (including myself) can pledge guilty of silently ignoring Java best practices. Unfortunately the magnitude of such a decision hunts you down later. The recent discussion about the name space issues of the OSGi headers, was the perfect reminder for me to give these small things more thorough thought, as we usually tend to liberately ignore them most of the time in favor of fast development. Well, at least I pledge betterment and hopefully so does every responsible developer, too <img src='http://osgi.mjahn.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Cheers,<br />
Mirko</p>
<p>*) Sorry, but I just can&#8217;t help it. In my opinion this header is not only a hurdle, but a real drawback from a componentization point of view. From a migration strategy approach, I guess the opposite applies, but what lasts longer &#8211; migration or maintenance?</p>
<p>&#8211;</p>
<div id="ref">References:</div>
<p>[1] <a title="external: Springsource News" href="http://www.springsource.com/web/guest/2008/applicationservermarket" target="_blank">http://www.springsource.com/web/guest/2008/applicationservermarket<br />
</a>[2] <a title="external: SpringSource Application Plattform" href="http://www.springsource.com/web/guest/products/suite/applicationplatform" target="_blank">http://www.springsource.com/web/guest/products/suite/applicationplatform</a><br />
[3] <a title="external: GPLv3" href="http://www.gnu.org/licenses/gpl.html" target="_blank">http://www.gnu.org/licenses/gpl.html</a><br />
[4] <a title="external: LOGBack" href="http://logback.qos.ch" target="_blank">http://logback.qos.ch</a><br />
[5] <a title="external: log4j Homepage" href="http://logging.apache.org/log4j" target="_blank">http://logging.apache.org/log4j</a><br />
[6] <a title="external: Glyn Normington's blog" href="http://underlap.blogspot.com/2008/04/springsource-application-platform-ships.html" target="_blank">http://underlap.blogspot.com/2008/04/springsource-application-platform-ships.html</a><br />
[7] <a title="external: Rob Harrop" href="http://blog.springsource.com/main/2008/04/30/introducing-the-springsource-application-platform/" target="_blank">http://blog.springsource.com/main/2008/04/30/introducing-the-springsource-<br />
application-platform</a><br />
[8] <a title="external: Adrian Colyers clarification" href="http://blog.springsource.com/main/2008/05/01/completing-the-picture-spring-osgi-and-the-springsource-application-platform/" target="_blank">http://blog.springsource.com/main/2008/05/01/completing-the-picture-spring-<br />
osgi-and-the-springsource-application-platform</a><br />
[9] <a title="external: SpringSource Component Repository" href="http://www.springsource.com/repository" target="_blank">http://www.springsource.com/repository</a><br />
[10] <a title="external: IAIK Website" href="http://jce.iaik.tugraz.at/" target="_blank">http://jce.iaik.tugraz.at</a><br />
[11] <a title="external: aQute Website" href="http://www.aqute.biz/Code/FileInstall" target="_blank">http://www.aqute.biz/Code/FileInstall</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fosgi.mjahn.net%2F2008%2F05%2F26%2Fspringsource-application-platform-the-next-step-forward-for-osgi%2F&amp;title=SpringSource%20Application%20Platform%20%E2%80%93%20the%20next%20step%20forward%20for%20OSGi%3F" id="wpa2a_20"><img src="http://osgi.mjahn.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://osgi.mjahn.net/2008/05/26/springsource-application-platform-the-next-step-forward-for-osgi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
