<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4562329366943275783</id><updated>2024-09-05T11:30:26.916+01:00</updated><category term="OSGi"/><category term="Java"/><category term="Nimble"/><category term="Sigil"/><category term="Cloud"/><category term="EclipseCon"/><category term="JSR277"/><category term="Modularity"/><category term="Scale"/><category term="Spring"/><category term="BND"/><category term="Gogo"/><category term="Ivy"/><category term="Maven"/><category term="Newton"/><category term="PDE"/><category term="Posh"/><category term="RFC 147"/><category term="SCA"/><category term="Starwars"/><title type='text'>Chronological Thought</title><subtitle type='html'>A collection of notes and musings on technical issues by David Savage</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-1335388125299971468</id><published>2010-10-18T10:35:00.000+01:00</published><updated>2010-10-18T10:35:13.440+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cloud"/><category scheme="http://www.blogger.com/atom/ns#" term="Modularity"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><category scheme="http://www.blogger.com/atom/ns#" term="Scale"/><title type='text'>OSGi &amp; The Cloud (Part 2)</title><content type='html'>This is the second blog entry in a series documenting the underlying points I made in my recent talk at the &lt;a href=&quot;http://communityevent.osgi.org/&quot;&gt;OSGi Community Event&lt;/a&gt; in London.&amp;nbsp; Entitled &quot;OSGi And Private Cloud&quot;,&amp;nbsp; the slides are available &lt;a href=&quot;http://www.slideshare.net/mfrancis/osgi-and-private-clouds&quot;&gt;here&lt;/a&gt; and the agenda is as follows:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Where is Cloud computing today? (&lt;a href=&quot;http://chronological-thought.blogspot.com/2010/10/osgi-cloud-part-1.html&quot;&gt;Part 1&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Where does OSGi fit in the Cloud architecture?&lt;/li&gt;
&lt;li&gt;What are the challenges of using OSGi in the Cloud?&lt;/li&gt;
&lt;li&gt;What does an OSGi Cloud platform look like?&lt;/li&gt;
&lt;/ul&gt;In this section of the talk I look at where OSGi fits into the Cloud architecture. However, as the community event was co-hosted with &lt;a href=&quot;http://jaxlondon.com/&quot;&gt;JAX London&lt;/a&gt; it wasn&#39;t a given that everyone at my talk would know OSGi. This is also possibly true for others reading this blog, so to make sure we&#39;re all starting from a similar page, I&#39;ll briefly explain the basics of what OSGi is about for those who have not come across it before.&lt;br /&gt;
&lt;ul&gt;&lt;/ul&gt;&lt;h3 class=&quot;Header&quot;&gt;OSGi A Quick Review&lt;/h3&gt;&lt;img align=&quot;right&quot; border=&quot;0&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZJ6-22kFO903qqzaSHoZXKEwJNaMJXzgJhsTF2cY2vPA6FDNs7d5sNamF_tk135JTy9PYt9CC4QUG96ZC2Wg2Zos9LyjtojLgQabK_0E5Uw0XHAnhy14cexV_HFJAfjjjVSA6dzf3iGk/s320/da-vinci-helicopter.jpg&quot; width=&quot;320&quot; /&gt;I&#39;ve been working with Richard Hall, Karl Pauls and Stuart McCulloch on writing &lt;a href=&quot;http://www.manning.com/hall/&quot;&gt;OSGi In Action&lt;/a&gt; which explains OSGi from first principles to advanced use cases, so if you want to know more that&#39;s a good place to look. However, here I&#39;d like to give my elevator pitch for OSGi which would be something like as follows...&lt;br /&gt;
&lt;br /&gt;
OSGi first became a standard in 1999 and provides a set of specifications for building dynamic modular Java applications. It has success stories in every area of Java development from embedded devices, though desktop applications to enterprise applications. The core features that OSGi provides a Java application are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Modules - the building blocks from which to create applications&lt;/li&gt;
&lt;li&gt;Life cycle - control when modules are installed or uninstalled and customise their behaviour when they are activated &lt;/li&gt;
&lt;li&gt;Services - minimal coupling between modules&lt;/li&gt;
&lt;/ul&gt;You might say that none of these are new ideas, so why is OSGi important? The key is in the standardisation of these fundamental axioms of Java applications. Instead of every software stack having a new and inventive way of wiring classloaders together, booting components, or connecting component A to component B, OSGi provides a minimal flexible specification that allows us to get interoperability between modules and let developers get on with the interesting part of building applications.&lt;br /&gt;
&lt;h3 class=&quot;Header&quot;&gt;An Uncomfortable Truth &lt;/h3&gt;&lt;img align=&quot;right&quot; border=&quot;0&quot; height=&quot;137&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh26GGjfDJL1AeYbenFZvD0yr4SSHO07xCTyKZl5mDkSJRjlKGpUG7D0Q_SOqVZSniJmqD8W2zvYMAZUlJKZWjE6NiR_YaxCLb8TpHkNqwccGHtqKSORz1PWSSaKIURtrYGW7FTjbmMB80/s320/software-increase.png&quot; width=&quot;320&quot; /&gt;To see where OSGi fits into the Cloud story it&#39;s worth taking a brief segue to consider a point made by &lt;a href=&quot;http://techdistrict.kirkk.com/2010/02/26/osgi-devcon-slides/&quot;&gt;Kirk Knoernschild&lt;/a&gt;  at the OSGi community event in February this year. Namely that we are generating more and more code with every passing day:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Lines of code double every 7 years&lt;/li&gt;
&lt;li&gt;50% of development time spent understanding code&lt;/li&gt;
&lt;li&gt;90% of software cost is maintenance and evolution&lt;/li&gt;
&lt;/ul&gt;By 2017, we&#39;ll have written not only double the amount of code written in the past 7 years but more than the total amount of code ever written combined! Object Orientation has helped in encapsulating our code so that changes in private implementation details do not effect consumers. But in fact OO turns out to be just a stop gap and it is reaching the limits of its capabilities. If you refactor public objects or methods you still need to worry about who is consuming these and without modules this can be a hard question to answer.&lt;br /&gt;
&lt;br /&gt;
Eric Newcomer of Credit Suisse gave another good talk at the recent community event on the scale of software development at the bank. The message I took away from this presentation is that within any large organisation, one can probably locate an example of virtually any computer algorithm ever conceived (in fact if you look hard enough you will more than likely find two). If we look out to small and medium sized organisations, sure they won&#39;t have pre-canned examples but any developer worth his salt can probably; knock up some approximation within a couple of days, find an open source library to do the same job, or part with some money to a vendor to get the job done.&lt;br /&gt;
&lt;br /&gt;
The message from these two presentations is, that as we move into the era of Cloud computing the real problem is not how to author code but how to manage and reuse code and to do so at scale. As businesses grow and Cloud makes hardware cheaper and cheaper to use,  market competition is driving computer software to larger and larger  scales to cope with increased processing, network and storage volumes. This scaling tends to lead to more complexity and often in an  exponential relationship.&amp;nbsp; But what do I mean by scale when talking about software in the Cloud? And how do we tame the complexity versus scale curve?&lt;br /&gt;
&lt;h3 class=&quot;Header&quot;&gt;Types of Scale&lt;/h3&gt;&lt;img align=&quot;right&quot; border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha3LBUbbcSQz8YreXhk1a1eGEuvEYkOZZriuEHwqE8maHNyzRCosNsm8hrPPFqMqid2vtThuY2vwutyMjQplcSMz6aZbO35FFegf8A-V8wPSYIT2cmp0YQ01BhQLzJrHmYADBorMOJ4IQ/s320/482251main_rosette_nebula_600x600.jpg&quot; width=&quot;320&quot; /&gt;&lt;br /&gt;
There are three measures of scale that I think are of relevance to this discussion of OSGi and the Cloud:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; Operational scale - the number of processors, network interfaces, storage options required to perform a function&lt;/li&gt;
&lt;li&gt;Architectural scale - the number and diversity of software components required to make up a system to perform a function&lt;/li&gt;
&lt;li&gt;Administrative scale - the number of configuration options that our architectures and our algorithms generate&lt;/li&gt;
&lt;/ul&gt;In fact, I think we&#39;ve got pretty good patterns by now for dealing with the operational scale. As we increase the number of physical resources at our disposal, this drives the class of software algorithms required to perform a function. To pick a random selection &lt;a href=&quot;http://en.wikipedia.org/wiki/Actor_model&quot;&gt;Actors&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Complex_event_processing&quot;&gt;CEP&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Distributed_hash_table&quot;&gt;DHTs&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Grid_computing&quot;&gt;Grid&lt;/a&gt; are just some of the useful software patterns for use in the Cloud. However, I think architectural and administrative scale is often less well managed.&lt;br /&gt;
&lt;br /&gt;
In terms of architectural scale, think about all the libraries we have to perform similar functions; logging, data access layers, RPC frameworks, web frameworks. How many of the millions of lines of code that we are generating are boilerplate copies of each other? Redundant architecture is a major problem in the growth of software. Which parts are really providing value to the business? Which parts are harmless clones of each other? Which parts are a maintenance cost that should be replaced? We employ abstractions to protect ourselves from underlying implementations but these abstractions can themselves become maintenance costs. I would argue that as software engineers we are suffering from the &lt;a href=&quot;http://en.wikipedia.org/wiki/The_Paradox_of_Choice:_Why_More_Is_Less&quot;&gt;paradox of choice&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
When managing code we need to worry about updating code, as code   is very  rarely a static entity; bugs are fixed, new APIs are  created,  old ones  are deprecated and removed. With the volume of code  in  existence, we need  mechanisms to manage the  complexity created by  the  constant churn of  logic that makes up our business systems. This leads us onto the problems of administrative scale.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Administrative scale hampers our ability to reason about and evolve deployed systems. The human brain has evolved to deal with relatively small connected graphs. But software today consists of multiple configuration options - libraries that implement APIs, network configurations, storage configurations, queue depths, the list is endless. When we look at the interconnected nature of many software architectures, do we really know what the impact of changing parts of the configuration will have?&lt;br /&gt;
&lt;br /&gt;
All this brings me to...&lt;br /&gt;
&lt;h3 class=&quot;Header&quot;&gt;OSGi Cloud Benefits &lt;/h3&gt;&lt;img align=&quot;right&quot; border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7T2x1v99kPJAvnFLflc3UCWwuwfrEQqKSPhjymXOCDz80vUuAPLs9dkHTB03ss6xiJ5ViRybQJkB4Z-Bd7SCdlUi6Qq5XW_r3lqRN6vFv3FAgdlC0eeeXgVldoXOpkNfXwkPkmXF_Ctg/s320/1072217_32589757.jpg&quot; width=&quot;240&quot; /&gt;In &lt;a href=&quot;http://chronological-thought.blogspot.com/2010/10/osgi-cloud-part-1.html&quot;&gt;Part 1&lt;/a&gt; of this series of blogs I mentioned that the &lt;a href=&quot;http://csrc.nist.gov/groups/SNS/cloud-computing/index.html&quot;&gt;Nist&lt;/a&gt;&lt;i&gt; &lt;/i&gt;definition of a cloud includes the statement that: &lt;i&gt;&quot;Cloud software takes full advantage of the cloud paradigm by being  service oriented with a focus on statelessness, low coupling, modularity  and semantic interoperability&quot;&lt;/i&gt;, to my mind OSGi has these bases covered.&lt;br /&gt;
&lt;br /&gt;
OSGi is a specification for modular Java that encourages low coupling via the use of services and it certainly allows you to build stateless applications. OSGi also promotes semantic interoperability via the fact that the code runs in a JVM and is abstracted from the underlying platform. Higher order levels of interoperability can easily be enabled using API and implementation modules that provide service abstractions around common platform functions, such as accessing data or scheduling tasks.&lt;br /&gt;
&lt;br /&gt;
But why should cloud software have these features? &lt;br /&gt;
&lt;br /&gt;
Returning to my theme of scale and complexity from the previous section, modularity and service orientated architectures enable encapsulation of coherent components to help reduce architectural complexity. Semantic interoperability aids in the war against administrative complexity as the same code can run no matter what hardware or network environment it is deployed in. Finally, stateless architectures are just a good design goal for dealing with production scale. &lt;br /&gt;
&lt;br /&gt;
OK interesting, but you might say that &quot;TechnologyX (pick your favourite) can also provide these features, so really sell me on the OSGi cloud benefits&quot;. In which case I propose that there are &lt;a href=&quot;http://en.wikipedia.org/wiki/The_Spanish_Inquisition_%28Monty_Python%29&quot;&gt;four&lt;/a&gt; additional benefits of OSGi with respect to Cloud software which I&#39;ll deal with in turn:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Dynamic&lt;/b&gt;: Clouds can be tempestuous environments with latency and contention being major factors. In these sorts of environments software that is designed to cope with runtime dependencies coming and going is more robust than static architectures. Consider the analogy with civil engineering and bridge or aeroplane wing design - rigid architectures are more fragile than those that incorporate degrees of flexibility. The Remote Services chapter from OSGi 4.2 specification promotes a discovery based services API. Thus, if a service dependency is lost due to movements in the Cloud then client code does not go into a spin making socket connect timeouts, it just gracefully moves into what ever state makes most sense and the rest of the processing can continue.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Extensible&lt;/b&gt;: Clouds are all about expansion so following good XP principles when  you start a new project you should only develop the parts of the  application you actually know are needed. However, versioned module dependencies and service interfaces mean that you can easily abstract or update simple implementations  as the application demands grow.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Lightweight&lt;/b&gt;: Clouds are meant be light, right? OSGi promotes modular design.&amp;nbsp; Modular designs in turn allow you to tune a software deployment to the actual task at hand. OSGi lifecycle and dynamic services patterns even allow us to extend an application at runtime. This enables all sorts of interesting new use cases, for example:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;if you need to get diagnostics information out of the software, only deploy the diagnostics components for the time that they are needed - for the rest of the time run lean&lt;/li&gt;
&lt;li&gt;if you need to scale up a certain component&#39;s processing power, swap an in-memory job queue for a distributed processing queue and when you&#39;re done swap it back again. &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Self describing&lt;/b&gt;: OSGi bundles contain a description of the module in their jar manifest files. This helps in the war against administrative complexity, notably via automation and audit. Just as an OSGi framework can validate that a bundle has been deployed with all its necessary dependencies, it is also possible to reverse this process and download required dependencies automatically. There are several implementations of this pattern already in use in OSGi today; &lt;a href=&quot;http://www.paremus.com/products/products.html&quot;&gt;Nimble&lt;/a&gt;, &lt;a href=&quot;http://felix.apache.org/site/apache-felix-osgi-bundle-repository.html&quot;&gt;OBR&lt;/a&gt; and &lt;a href=&quot;http://wiki.eclipse.org/Equinox_p2&quot;&gt;P2&lt;/a&gt;. This simplifies deployments by allowing software engineers to focus on what they &lt;i&gt;want&lt;/i&gt; to deploy instead of what they &lt;i&gt;need&lt;/i&gt; to deploy.&lt;br /&gt;
&lt;br /&gt;
In terms of audit, OSGi bundles have a number of standardised headers to describe meta features such as name, description, license and documentation, so if you want to find out about a piece of software in a bundle just look at its manifest information. Once you get into this frame of thinking, other meta data such as author, build date, business unit also make sense to be embedded into the bundle. This sort of meta information can greatly benefit system admins and system builders in the future.&lt;br /&gt;
&lt;h3 class=&quot;Header&quot;&gt;OSGi Cloud Services&lt;/h3&gt;To conclude this post, assuming I&#39;ve managed to convince you of the benefits of OSGi in Cloud architectures, here are some ideas for potential cloud OSGi services (definitely non exhaustive): &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;MapReduce services - Hadoop or Bigtable implementations?&lt;/li&gt;
&lt;li&gt;Batch services - Plug and play Grids?&lt;/li&gt;
&lt;li&gt;NoSQL services - Scalable data for the Cloud!&lt;/li&gt;
&lt;li&gt;Communications services - Email, Calendars, IM, Twitter?&lt;/li&gt;
&lt;li&gt;Social networking services - Cross platform widgets?&lt;/li&gt;
&lt;li&gt;Billing services - Making money in the Cloud! &lt;/li&gt;
&lt;li&gt;AJAX/HTML 5.0 services - Pluggable UI architectures? &lt;/li&gt;
&lt;/ul&gt;These would enable developers to start building modular, dynamic, scalable applications for the Cloud and are in fact pretty simple to achieve if there&#39;s the will power to make it happen.&lt;br /&gt;
&lt;br /&gt;
I think OSGi provides an excellent foundation  for building Cloud software. There are things it doesn&#39;t do but its  extensible nature means that it is very easy to build additional tools  on top of it and really start addressing the problems of scale. I&#39;ll look at some of tools I&#39;ve been working on in this area in the final post.&lt;br /&gt;
&lt;br /&gt;
So all good right? Well there are still of course challenges, so in the next post I&#39;ll look at some of these and discuss how to overcome these. In the meantime, I&#39;m very interested in any feedback on the ideas found in this post.&lt;br /&gt;
&lt;br /&gt;
Laters</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/1335388125299971468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/1335388125299971468' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/1335388125299971468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/1335388125299971468'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2010/10/osgi-cloud-part-2.html' title='OSGi &amp; The Cloud (Part 2)'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZJ6-22kFO903qqzaSHoZXKEwJNaMJXzgJhsTF2cY2vPA6FDNs7d5sNamF_tk135JTy9PYt9CC4QUG96ZC2Wg2Zos9LyjtojLgQabK_0E5Uw0XHAnhy14cexV_HFJAfjjjVSA6dzf3iGk/s72-c/da-vinci-helicopter.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-7353642637994533426</id><published>2010-10-08T14:08:00.003+01:00</published><updated>2010-10-18T10:48:41.620+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cloud"/><category scheme="http://www.blogger.com/atom/ns#" term="Modularity"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><category scheme="http://www.blogger.com/atom/ns#" term="Scale"/><title type='text'>OSGi &amp; The Cloud (Part 1)</title><content type='html'>&lt;a href=&quot;http://sed-rah-stock.deviantart.com/gallery/#/d2n605z&quot;&gt;&lt;img align=&quot;right&quot; border=&quot;0&quot; height=&quot;130&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfbe48KNJ10y_NReev0zDc07MfihgCADZvA2SAaPTOT8GTLzoHI4X_89n9frwYZbWrLN8llUDCmzHYGsNAqy_XPKyoVUWuSWxAwr9Ff85imMH8r2P5ElsVGXg41slrc_RvBW_BD4SXrX4/s400/Sky_46_by_Sed_rah_Stock_resized.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
I recently attended the &lt;a href=&quot;http://communityevent.osgi.org/&quot;&gt;OSGi Community Event&lt;/a&gt; where I gave a talk entitled &quot;OSGi And Private Cloud&quot; the slides for which are available &lt;a href=&quot;http://www.slideshare.net/mfrancis/osgi-and-private-clouds&quot;&gt;here&lt;/a&gt;. However as has been pointed &lt;a href=&quot;http://twitter.com/pragkirk/status/26654985604&quot;&gt;out&lt;/a&gt;, if you watch the slide deck they&#39;re a little on the zen side, so if you weren&#39;t at the event then it&#39;s a bit difficult to guess the underlying points I was trying to make.&lt;br /&gt;
&lt;br /&gt;
To address this I&#39;ve decided to create a couple of blog entries that discuss the ideas I was trying to get across. Hopefully this will be of interest to others.&lt;br /&gt;
&lt;br /&gt;
In the talk the agenda was as follows:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Where is Cloud computing today?&lt;/li&gt;
&lt;li&gt;Where does OSGi fit in the Cloud architecture? (&lt;a href=&quot;http://chronological-thought.blogspot.com/2010/10/osgi-cloud-part-2.html&quot;&gt;Part 2&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;What are the challenges of using OSGi in the Cloud?&lt;/li&gt;
&lt;li&gt;What does an OSGi cloud platform look like?&lt;/li&gt;
&lt;/ul&gt;I&#39;ll stick to this flow but break these sections up into separate blog entries. So here goes with the first section...&lt;br /&gt;
&lt;h3 class=&quot;Header&quot;&gt;Where is Cloud computing today?&lt;/h3&gt;Ironically Cloud computing is viewed by many as a pretty nebulous technology so before even describing &lt;i&gt;where&lt;/i&gt; Cloud computing is, it&#39;s possibly useful to define &lt;i&gt;what&lt;/i&gt; Cloud computing is.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Wikipedia &lt;a href=&quot;http://en.wikipedia.org/wiki/Cloud_computing&quot;&gt;defines&lt;/a&gt; a Cloud as: &quot;Internet-based computing, whereby shared resources, software, and information are provided to computers and other devices on demand, like the electricity grid&quot;.&lt;/li&gt;
&lt;li&gt;InfoWorld &lt;a href=&quot;http://www.infoworld.com/d/cloud-computing/what-cloud-computing-really-means-031&quot;&gt;defines&lt;/a&gt; Cloud as: &quot;[sic] a way to increase capacity or add capabilities on the fly without investing in new infrastructure, training new personnel, or licensing new software. Cloud computing encompasses any subscription-based or pay-per-use service that, in real time over the Internet, extends IT&#39;s existing capabilities&quot;.&lt;/li&gt;
&lt;li&gt;NIST &lt;a href=&quot;http://csrc.nist.gov/groups/SNS/cloud-computing/index.html&quot;&gt;defines&lt;/a&gt; (see the &quot;NIST Definition of Cloud Computing&quot; link) a Cloud as: &quot;a model for enabling convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction&quot;&lt;/li&gt;
&lt;/ul&gt;For me all of these definitions seem pretty similar to Utility computing. Again wikipedia &lt;a href=&quot;http://en.wikipedia.org/wiki/Utility_computing&quot;&gt;defines&lt;/a&gt; Utility computing as &quot;[sic] the packaging of computing resources, such as computation, storage and services, as a metered service similar to a traditional public utility (such as electricity, water, natural gas or telephone network)&quot;. So what is the boundary between Utility computing and Cloud computing? Others have attempted to define Cloud by what it is &lt;a href=&quot;http://www.redmonk.com/jgovernor/2008/03/13/15-ways-to-tell-its-not-cloud-computing/&quot;&gt;not&lt;/a&gt;. I tend to agree with some of these points but not others.&lt;br /&gt;
&lt;br /&gt;
So where does this leave us…?&lt;br /&gt;
&lt;br /&gt;
Actually I think the NIST definition I referred to above does a good job of describing what Cloud is as long as you read past the first sentence. For me the summary of this document is that:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Cloud is computation that is: on demand; easily accessed from a network; with pooled resources; and rapid elasticity.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
As a final foot note in the NIST document it mentions that:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&quot;Cloud software takes full advantage of the cloud paradigm by being service oriented with a focus on statelessness, low coupling, modularity and semantic interoperability&quot;.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
This last sentence for me is of fundamental importance when considering the relevance OSGi to the Cloud.&lt;br /&gt;
&lt;br /&gt;
I&#39;m tempted to break off from the flow of the slides here and leap to the conclusion but I&#39;ve set my self a goal of explaining my presentation. So before I explore this point further I&#39;ll continue with the slide deck as presented but rest assured this point will be returned to.&lt;br /&gt;
&lt;h3 class=&quot;Header&quot;&gt;Why Cloud?&lt;/h3&gt;So as the previous discussion suggests, the reason for using a Cloud model is it gives users just in time:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Processing power&lt;/li&gt;
&lt;li&gt;Storage capacity&lt;/li&gt;
&lt;li&gt;Network capacity. &lt;/li&gt;
&lt;/ul&gt;Clouds models are great for small, medium and large organisations.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Small organisations benefit from the reduced startup costs of Clouds compared with setting up and provisioning home grown infrastructure for web sites, email, accounting software, etc. &lt;/li&gt;
&lt;li&gt;Medium sized organisations benefit from the on demand nature of Clouds - as their business grows so can their infrastructure &lt;/li&gt;
&lt;li&gt;Large organisations benefit from Cloud due to their shared resources - instead of having to maintain silos of computing infrastructure for different departments they can get cost savings via economy of scale.&lt;/li&gt;
&lt;/ul&gt;There are a large number of vendors touting Cloud products, including &lt;a href=&quot;http://aws.amazon.com/&quot;&gt;Amazon&lt;/a&gt;, &lt;a href=&quot;http://code.google.com/appengine/&quot;&gt;Google&lt;/a&gt;, &lt;a href=&quot;http://www.salesforce.com/&quot;&gt;Salesforce&lt;/a&gt;, &lt;a href=&quot;http://www.rackspacecloud.com/&quot;&gt;Rackspace&lt;/a&gt;, &lt;a href=&quot;http://www.microsoft.com/windowsazure/&quot;&gt;Microsoft&lt;/a&gt;, &lt;a href=&quot;http://www.ibm.com/ibm/cloud/&quot;&gt;IBM&lt;/a&gt;, &lt;a href=&quot;http://www.vmware.com/solutions/cloud-computing/&quot;&gt;VMware&lt;/a&gt; and &lt;a href=&quot;http://www.paremus.com/products/products_psf.html&quot;&gt;Paremus&lt;/a&gt;. These products fit into various categories of Cloud, IAAS (Infrastructure as a Service), PAAS (Platform as a Service), SAAS (Software as a Service) and Public or Private Cloud.&lt;br /&gt;
&lt;h3 class=&quot;Header&quot;&gt;Cloud Realities&lt;/h3&gt;&lt;a href=&quot;http://www.sxc.hu/photo/1260304&quot;&gt;&lt;img align=&quot;right&quot; border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyFPT-oBJ_wYBAAIdLQD9TkUguWAk16XiJImLT6mSq0IOL_8oycyBjBy6r1oGINmG0Siih-pr-_uFvEAr5auaGZAZZet7L6sV3EVI4PdLKlGLrYLOBUf5r6LuscV9TvK9fk9fFI6MzsY8/s400/sheep-clouds.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
So Cloud seems pretty utopian right? In fact despite promise of Cloud the realities it delivers are somewhat different.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;As there are so many vendors, there are also multiple APIs that developers need to code to for simple things they used to do like loading resources &lt;/li&gt;
&lt;li&gt;Depending on the vendor the sort of things you can do in a Cloud are often limited (in Google App Engine you can&#39;t create Threads for example) &lt;/li&gt;
&lt;li&gt;Some vendors package Clouds as VM images and for simple deployments this is perfectly ok. However, as the number and variation of applications changes the course grained nature of VM images is a prohibitive factor. The system administrator needs to build and manage lots of different VM image configurations.&lt;/li&gt;
&lt;/ul&gt;Finally, and this is a factor that effects all Clouds, they are &lt;i&gt;not&lt;/i&gt; - despite marketing - &lt;a href=&quot;http://www.webmetrics.com/landingpage/bitcurrentcloud2/The_Performance_of_Clouds_Complete.pdf&quot;&gt;infinite resources&lt;/a&gt; (pdf). Contention and latency are real problems in Cloud environments. The the shared nature of Cloud architectures means that SLAs can be severely impacted by seemingly random processing spikes by other tenants. Cloud providers employ many different tactics to minimise these problems but running an application in the Cloud and running it on dedicated hardware is not a seamless transition.&lt;br /&gt;
&lt;h3 class=&quot;Header&quot;&gt;Why Private Cloud?&lt;/h3&gt;If Clouds are about shared resources and mimic utility services like electricity, gas or water, why would organisations choose to host their own Clouds? Well, it basically comes down to a healthy dose of paranoia. For large organisations the risks associated with Public Cloud are just too great for many of their business processes. Concerns often touted in the industry are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Data ownership risks – A bank for example is often extremely reluctant to host private customer details on infrastructure they don&#39;t own. This can be for legal/regulatory reasons or business intelligence reasons&lt;/li&gt;
&lt;li&gt;Data inertia – I&#39;ve heard one horror story at a previous &lt;a href=&quot;http://www.cloudcamp.org/&quot;&gt;Cloud Camp&lt;/a&gt; in London about a Web2.0 portal that had started their business in the Cloud (I forget which one). However once it got successful its users were creating data in the Cloud faster than they could offload it, meaning they had a hell of a job moving providers once they started. Not a good position to be in from a price/negotiation perspective&lt;/li&gt;
&lt;li&gt;API lock-in – The requirement to code to vendor specific APIs is a major problem in terms of vendor lock-in. As a small company the cost of starting out is pretty minimal but once the business starts to scale, finding you are locked into an uncompetitive pricing plan is obviously not good for business&lt;/li&gt;
&lt;li&gt;SLA – The contention and latency issues of Clouds can mean that for those businesses that are are in a competitive compute-intensive business then any downtime or latency outside of your control can have a major effect on your bottom line.&lt;/li&gt;
&lt;/ul&gt;Private Cloud implies all of the on-demand, dynamic, network accessible goodness, but in a controlled environment where the business has direct control of the cloud tentants, so can better control their SLA. A bit like owning a well, or growing your own food, there are costs but also benefits.&lt;br /&gt;
&lt;br /&gt;
This pretty much takes me to the end of the beginning. I left this section with a question posed in the form of a set of images (which I&#39;ve used in this blog entry). The Cloud vision is certainly an enticing one and there are already a lot of commercial benefits to using Cloud in day-to-day business. However, there are definitely still problems. The final question is...&lt;br /&gt;
&lt;h3 class=&quot;Header&quot;&gt;How Do We Get Here?&lt;/h3&gt;&lt;a href=&quot;http://antwrp.gsfc.nasa.gov/apod/fap/image/0912/M51HST-GendlerMr.jpg&quot;&gt;&lt;img align=&quot;right&quot; border=&quot;0&quot; height=&quot;277&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgr6bq_b1PdHnBJDvuSAY9ItFwzVaSlqmz94FaKKQfJU0izFYZlHSQulsFSvoIMZzw2_fkTaeCT4pBbIVn6fMeRv0mIipwqShwRttokuA08Mt3LxC-BiutwFqFgXx_APqncQg7ATUCpuho/s400/420970main_M51HST-GendlerMr_full_rotated.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;This is M51a “The whirlpool galaxy” discovered by Charles Messier in 1774 (and its companion galaxy NGC 5195). &lt;br /&gt;
&lt;br /&gt;
I came at computing from the physics angle and when I think of computer software/architecture I tend to think in terms of patterns. A galaxy is just a cloud of gas after all - but there is structure, dynamicity and mechanics that describe their overall behaviour! &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Homogeneous Cloud deployments can be inefficient – sometimes local processing is just faster than distributed algorithms. We need fidelity in our Cloud deployments, but with fidelity comes administrative cost. Dealing with fine grained structure on the scale of millions (or even tens of thousands) of nodes requires new models&lt;/li&gt;
&lt;li&gt;Clouds are dynamic, resources come and go, their can be gaps in communication caused by latency, their can even be large scale events like data centre collapse. Software that is deployed on them must be able to cope with these dynamics&lt;/li&gt;
&lt;li&gt;As anyone who has worked on any large or even medium sized software project knows, software is often a tangled web of interdependencies. Changing the processing laws in local parts of an architecture can have drastic effects on distant components. We need ways of encapsulating and segmenting Cloud software to allow for updates.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
There we go, I&#39;ll try to write up the next section &quot;Where does OSGi fit in the cloud&quot; soon. But to look briefly into the future (or the past - depending on your perspective), I think we need to use modularisation and abstraction to help tame the complexity/scale curve and this is where OSGi fits into the Cloud model.&lt;br /&gt;
&lt;br /&gt;
In the mean time, I&#39;m very interested in any comments or feedback on any of the ideas discussed here.&lt;br /&gt;
&lt;br /&gt;
Laters,</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/7353642637994533426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/7353642637994533426' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/7353642637994533426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/7353642637994533426'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2010/10/osgi-cloud-part-1.html' title='OSGi &amp; The Cloud (Part 1)'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfbe48KNJ10y_NReev0zDc07MfihgCADZvA2SAaPTOT8GTLzoHI4X_89n9frwYZbWrLN8llUDCmzHYGsNAqy_XPKyoVUWuSWxAwr9Ff85imMH8r2P5ElsVGXg41slrc_RvBW_BD4SXrX4/s72-c/Sky_46_by_Sed_rah_Stock_resized.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-8294190423294715944</id><published>2009-12-02T12:50:00.002+00:00</published><updated>2009-12-02T13:23:25.083+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Gogo"/><category scheme="http://www.blogger.com/atom/ns#" term="Nimble"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><category scheme="http://www.blogger.com/atom/ns#" term="RFC 147"/><category scheme="http://www.blogger.com/atom/ns#" term="Starwars"/><title type='text'>Hello Tatooine</title><content type='html'>&lt;p&gt;So in my last couple of posts I&#39;ve been showing the power of Nimble. You will have noticed that it is primarily a console environment. As such you may be wondering how you can provide your own commands to execute in the &lt;a href=&quot;http://www.paremus.com/products/products_nimble.html&quot;&gt;Nimble&lt;/a&gt; shell - &lt;a href=&quot;http://docs.paremus.com/display/NIM10/The+Posh+Shell&quot;&gt;Posh&lt;/a&gt; (Paremus OSGi Shell).&lt;/p&gt;&lt;p&gt;Posh is an implementation of the command line interface specified in &lt;a href=&quot;http://www.osgi.org/download/osgi-4.2-early-draft.pdf&quot;&gt;RFC-147&lt;/a&gt; from the OSGi alliance. If you are familiar with OSGi development you will know that to date every framework implementation has defined it&#39;s own particular API for providing command line utilities within an OSGi runtime. This has meant that there is significant duplication of effort when writing commands to work in the various environments.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To this end the alliance proposed RFC 147 in order to provide a common standard that different frameworks could implement such that a command that worked in one framework could work unchanged in another. The initial implementation of RFC 147 was developed primarily by Peter Kriens and donated to the Felix project earlier this year. Since then there have been a number of maintenance releases and it has been included as a component of the Felix &lt;a href=&quot;http://felix.apache.org/site/apache-felix-karaf.html&quot;&gt;Karaf&lt;/a&gt; container and the Nimble container from Paremus.&lt;/p&gt;&lt;p&gt;This gives you some background, so now the standard thing for me to do would be to write a trivial hello world application. But that&#39;s no fun, so instead of conforming to the norm I thought it would be more interesting to port the &lt;a href=&quot;http://www.asciimation.co.nz/&quot;&gt;Starwars Asciimation&lt;/a&gt; work to run in OSGi as an RFC 147 command line interface.&lt;/p&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBFtS7uIwgFo2ITcWNsNdzm1Fpy7Hdrq6of0rx67qIztPT6IfxZzG5lDObW24UMxWV1xeOj13LcJu3twf73CG_-P18qHZyFzMnBknz1_fho_vy_F3ooXtD6GQUHHQuf8wT8TujFYd3rW8/s1600/Picture+4.png&quot;&gt;&lt;img 0=&quot;&quot; 10px=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBFtS7uIwgFo2ITcWNsNdzm1Fpy7Hdrq6of0rx67qIztPT6IfxZzG5lDObW24UMxWV1xeOj13LcJu3twf73CG_-P18qHZyFzMnBknz1_fho_vy_F3ooXtD6GQUHHQuf8wT8TujFYd3rW8/s320/Picture+4.png&quot; alt=&quot;&quot; id=&quot;Gogo Starwars&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Yep this is very probably the geekiest post you will ever see... :)&lt;/p&gt;&lt;p&gt;I hasten to add that I did not undertake the core task of this myself, instead I took the liberty of contacting Simon Jansen (the author of Asciimation) to ask his permission to &quot;borrow&quot; the ascii text from his player. This he was very kind to do.&lt;/p&gt;&lt;p&gt;The first thing we need to do to define our cli is define a class that implements the core functionality as shown below:&lt;/p&gt;&lt;pre&gt;package org.chronologicalthought;&lt;br /&gt;&lt;br /&gt;import java.io.BufferedInputStream;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.InputStream;&lt;br /&gt;import java.io.InputStreamReader;&lt;br /&gt;import java.io.PrintStream;&lt;br /&gt;import java.io.Reader;&lt;br /&gt;import java.net.URL;&lt;br /&gt;&lt;br /&gt;public class Starwars {&lt;br /&gt; public void starwars() throws IOException, InterruptedException {&lt;br /&gt;   play(67);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void starwars(int frameLength) throws IOException, InterruptedException {&lt;br /&gt;   URL res = Starwars.class.getResource(&quot;/starwars.txt&quot;);&lt;br /&gt;   if (res == null)&lt;br /&gt;     throw new IllegalStateException(&quot;Missing resource&quot;);&lt;br /&gt;   InputStream in = res.openStream();&lt;br /&gt;   try {&lt;br /&gt;     InputStreamReader reader = new InputStreamReader(new BufferedInputStream(in));&lt;br /&gt;     render(reader, System.out, frameLength);&lt;br /&gt;   } finally {&lt;br /&gt;     in.close();&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private void render(Reader reader, PrintStream out, int frameLength) {&lt;br /&gt;   // ...&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt;Here the command provides two methods, play and play(int) and prints the individual frames from the &quot;starwars.txt&quot; file embedded in our bundle to System.out.&lt;/p&gt;&lt;p&gt;Wait a minute you might be thinking. Where&#39;s the API to the CLI? Well this is one of the neat things about RFC 147 you don&#39;t need to write your code to &lt;em&gt;any&lt;/em&gt; API. The specification provides a clever utility in the form of a ThreadIO service that multiplexes the references to System.in, System.out, and System.err so the command can interact with the user. It also calls methods on the class reflectively so there is no need to implement a defined interface. Simply declare a method and Posh will attempt to convert arguements supplied from the command line to match the method signature.&lt;/p&gt;&lt;p&gt;The next step is to define an activator that publishes our cli class to the OSGi bundle context.&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;package org.chronologicalthought;&lt;br /&gt;&lt;br /&gt;import java.util.Hashtable;&lt;br /&gt;import org.osgi.service.command.CommandProcessor;&lt;br /&gt;&lt;br /&gt;import org.osgi.framework.BundleActivator;&lt;br /&gt;import org.osgi.framework.BundleContext;&lt;br /&gt;&lt;br /&gt;public class Activator implements BundleActivator {&lt;br /&gt;&lt;br /&gt;  public void start(BundleContext ctx) throws Exception {&lt;br /&gt;    Hashtable props = new Hashtable();&lt;br /&gt;    props.put(CommandProcessor.COMMAND_SCOPE, &quot;ct&quot;);&lt;br /&gt;    props.put(CommandProcessor.COMMAND_FUNCTION, new String[] { &quot;starwars&quot; });&lt;br /&gt;    ctx.registerService(Starwars.class.getName(), new Starwars(), props);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void stop(BundleContext ctx) throws Exception {&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt;This activator publishes the Starwars class with two attributes:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;CommandProcessor.COMMAND_SCOPE - a unique namespace for our command&lt;/li&gt;&lt;li&gt;CommandProcessor.COMMAND_FUNCTION - the names of the methods to expose as commands in the cli&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The code is available from &lt;a href=&quot;http://chronological-thought.googlecode.com/&quot;&gt;here&lt;/a&gt; for those who want to take a look around:&lt;/p&gt;&lt;p&gt;Now the final stage is to load our command within nimble. Since my cli has such a trivial set of dependencies I will defer the usage of the full nimble resolution to another blog post. So instead I will use a set of trivial commands which I&#39;ve defined &lt;a href=&quot;http://chronological-thought.googlecode.com/svn/trunk/nimble-examples/basic-commands.osh&quot;&gt;here&lt;/a&gt;. So finally let the show commence:&lt;pre&gt;$ svn co http://chronological-thought.googlecode.com/svn/trunk/starwars&lt;br /&gt;$ cd starwars&lt;br /&gt;$ ant&lt;br /&gt;$ posh&lt;br /&gt;Paremus Nimble 30-day license, expires Wed Dec 30 23:59:59 GMT 2009.&lt;br /&gt;________________________________________&lt;br /&gt;Welcome to Paremus Nimble!&lt;br /&gt;Type &#39;help&#39; for help.&lt;br /&gt;[feynman.local.0]% source http://chronological-thought.googlecode.com/svn/trunk/nimble-examples/basic-commands.osh&lt;br /&gt;[feynman.local.0]% installAndStart file:build/lib/org.chronologicalthought.starwars.jar&lt;br /&gt;[feynman.local.0]% starwars&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                       WWW.ASCIIMATION.CO.NZ&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                             presents&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The final piece of Nimble functionality that it would be fun to demonstrate is stopping the movie. Simply hit Ctrl-C. The nimble shell then sends a Thread.interrupt to the currently running command. For those who want to see the movie to the end and don&#39;t want to wait try running:&lt;/p&gt;&lt;pre&gt;% starwars 20&lt;/pre&gt;&lt;p&gt;To set the frame length as 20 milliseconds.&lt;/p&gt;&lt;p&gt;Enjoy the show.&lt;/p&gt;&lt;p&gt;Laters.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/8294190423294715944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/8294190423294715944' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/8294190423294715944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/8294190423294715944'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2009/11/hello-tatooine.html' title='Hello Tatooine'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBFtS7uIwgFo2ITcWNsNdzm1Fpy7Hdrq6of0rx67qIztPT6IfxZzG5lDObW24UMxWV1xeOj13LcJu3twf73CG_-P18qHZyFzMnBknz1_fho_vy_F3ooXtD6GQUHHQuf8wT8TujFYd3rW8/s72-c/Picture+4.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-5830064349979732073</id><published>2009-12-01T16:04:00.003+00:00</published><updated>2009-12-01T16:26:43.154+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Nimble"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><category scheme="http://www.blogger.com/atom/ns#" term="Posh"/><title type='text'>And for my next trick</title><content type='html'>Just for fun and to demonstrate the power of the Posh (sh)ell environment I decided to knock together the following trivial script to do a &quot;traditional&quot; OSGi bundle file install from a directory:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;// create a temporary array for storing ids&lt;br /&gt;array = new java.util.ArrayList;&lt;br /&gt;&lt;br /&gt;// iterate over the files passed &lt;br /&gt;// in as arguement 1 to this script&lt;br /&gt;each (glob $1/*) {&lt;br /&gt;&lt;br /&gt;  // use the BundleContext.installBundle &lt;br /&gt;  // method to install each bundle&lt;br /&gt;  id=osgi:installBundle $it;&lt;br /&gt;&lt;br /&gt;  // store the bundle id for start later&lt;br /&gt;  $array add $id;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;// iterate over our installed bundles&lt;br /&gt;each ($array) {&lt;br /&gt;  // use the BundleContext.start method&lt;br /&gt;  //to start it&lt;br /&gt;  osgi:start $it;&lt;br /&gt;};&lt;/pre&gt;&lt;br /&gt;To try this out for yourself or to find out more about Nimble you look &lt;a href=&quot;http://www.paremus.com/products/products_nimble.html&quot;&gt;here&lt;/a&gt; once installed you can run the above script using the following command:&lt;br /&gt;&lt;br /&gt;posh -k http://chronological-thought.googlecode.com/svn/trunk/nimble-examples/file-install.osh &amp;lt;your bundles dir&amp;gt;&lt;br /&gt;&lt;br /&gt;Where you should replace &amp;lt;your bundles dir&amp;gt; with a path to a directory on your local file system that contains bundles.&lt;br /&gt;&lt;br /&gt;Hmmm what to blog next...ponders...&lt;br /&gt;&lt;br /&gt;Laters,</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/5830064349979732073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/5830064349979732073' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/5830064349979732073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/5830064349979732073'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2009/12/and-for-my-next-trick.html' title='And for my next trick'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-2467854638125225599</id><published>2009-12-01T10:08:00.005+00:00</published><updated>2009-12-01T15:46:40.882+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Nimble"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><title type='text'>Nimble OSGi</title><content type='html'>So I just sent a rather cryptic &lt;a href=&quot;http://twitter.com/davemssavage&quot;&gt;twitter&lt;/a&gt; message with the instructions:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;posh -kc &quot;repos -l springdm;add org.springframework.osgi.samples.simplewebapp@active&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I figure it&#39;s probably worth a short note to explain what this is doing given the narrowband aspect of twitter communications.&lt;br /&gt;&lt;br /&gt;This command is running an instance of the posh (sh)ell which ships with &lt;a href=&quot;http://www.paremus.com/products/products.html&quot;&gt;Nimble&lt;/a&gt;. There are two switch parameters parsed to the shell:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;-c&lt;/span&gt;: Tells posh to execute the command passed in from the unix shell in the posh (sh)ell environment&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;-k&lt;/span&gt;: Tells posh to remain running after the command has completed and open a tty session for user input&lt;br /&gt;&lt;br /&gt;Now we come to the actual commands:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;repos -l springdm&lt;/span&gt;: tells posh to load the spring dm repository index into the nimble resolver&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;add org.springframework.osgi.samples.simplewebapp@active&lt;/span&gt;: tells nimble to resolve all dependencies for the spring simplewebapp from it&#39;s configured repositories.&lt;br /&gt;&lt;br /&gt;The interesting thing about nimble resolution is that it doesn&#39;t just figure out the bundles that need to be installed. It also figures out what &lt;em&gt;state&lt;/em&gt; these bundles should be in. If you look at the bundles in the nimble container using the command&lt;span style=&quot;font-family:monospace;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;lsb&lt;/span&gt; you will see that not only are all the bundles installed but certain key bundles have also been activated:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;lsb&lt;br /&gt;*nimble/com.paremus.util.cmds-1.0.4.jar                           00:00    59Kb&lt;br /&gt;0  ACTIVE    org.eclipse.osgi:3.5.1.R35x_v20090827&lt;br /&gt;1  ACTIVE    com.paremus.posh.runtime:1.0.4&lt;br /&gt;2  ACTIVE    com.paremus.posh.shell:1.0.4&lt;br /&gt;3  RESOLVED  com.paremus.util.types:1.0.4&lt;br /&gt;4  ACTIVE    com.paremus.nimble.core:1.0.4&lt;br /&gt;5  ACTIVE    com.paremus.nimble.repos:1.0.4&lt;br /&gt;6  ACTIVE    com.paremus.nimble.cli:1.0.4&lt;br /&gt;7  RESOLVED  javax.servlet:2.5.0.v200806031605&lt;br /&gt;8  RESOLVED  com.springsource.slf4j.api:1.5.6&lt;br /&gt;9  RESOLVED  com.springsource.slf4j.nop:1.5.6&lt;br /&gt;10  RESOLVED  com.springsource.net.sf.cglib:2.1.3&lt;br /&gt;11  RESOLVED  com.springsource.edu.emory.mathcs.backport:3.1.0&lt;br /&gt;12  RESOLVED  org.springframework.osgi.log4j.osgi:1.2.15.SNAPSHOT&lt;br /&gt;13  RESOLVED  com.springsource.org.aopalliance:1.0.0&lt;br /&gt;14  RESOLVED  org.springframework.osgi.jsp-api.osgi:2.0.0.SNAPSHOT&lt;br /&gt;15  RESOLVED  com.springsource.slf4j.org.apache.commons.logging:1.5.6&lt;br /&gt;16  RESOLVED  osgi.cmpn:4.2.0.200908310645&lt;br /&gt;17  RESOLVED  org.mortbay.jetty.util:6.1.9&lt;br /&gt;18  RESOLVED  org.springframework.osgi.jstl.osgi:1.1.2.SNAPSHOT&lt;br /&gt;19  RESOLVED  org.springframework.core:2.5.6.A&lt;br /&gt;20  RESOLVED  org.springframework.osgi.commons-el.osgi:1.0.0.SNAPSHOT&lt;br /&gt;21  RESOLVED  org.mortbay.jetty.server:6.1.9&lt;br /&gt;22  ACTIVE    org.springframework.osgi.samples.simplewebapp:0.0.0&lt;br /&gt;23  RESOLVED  org.springframework.beans:2.5.6.A&lt;br /&gt;24  RESOLVED  org.springframework.osgi.io:1.2.0&lt;br /&gt;25  RESOLVED  org.springframework.osgi.jasper.osgi:5.5.23.SNAPSHOT&lt;br /&gt;26  RESOLVED  org.springframework.aop:2.5.6.A&lt;br /&gt;27  RESOLVED  org.springframework.osgi.catalina.osgi:5.5.23.SNAPSHOT&lt;br /&gt;28  RESOLVED  org.springframework.context:2.5.6.A&lt;br /&gt;29  ACTIVE    org.springframework.osgi.catalina.start.osgi:1.0.0&lt;br /&gt;30  RESOLVED  org.springframework.osgi.core:1.2.0&lt;br /&gt;31  RESOLVED  org.springframework.web:2.5.6.A&lt;br /&gt;32  RESOLVED  org.springframework.osgi.web:1.2.0&lt;br /&gt;33  ACTIVE    org.springframework.osgi.web.extender:1.2.0&lt;br /&gt;34  ACTIVE    com.paremus.posh.readline:1.0.4&lt;br /&gt;35  ACTIVE    com.paremus.util.cmds:1.0.4&lt;/pre&gt;&lt;br /&gt;This listing also demonstates another key feature of nimble. Typing&lt;span style=&quot;font-family:monospace;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;lsb&lt;/span&gt; resulted in the following log line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;*nimble/com.paremus.util.cmds-1.0.4.jar                           00:00    59Kb&lt;/pre&gt;&lt;br /&gt;This demonstrates that the nimble container resolved the&lt;span style=&quot;font-family:monospace;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;lsb&lt;/span&gt; command from its repository index and installed it on the fly. In fact if you look at the Nimble download it is only 55K in size. All of the extra functionality is automatically downloaded based on information provided via the nimble index files and traversing package and service level dependencies!&lt;br /&gt;&lt;br /&gt;To complete this blog post you can browse the simple web app running from nimble by opening:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;http://localhost:8080/simple-web-app/&lt;/pre&gt;&lt;br /&gt;Nimble is available for download &lt;a href=&quot;https://store.paremus.com/nimble_download_with_30_day_license/&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/2467854638125225599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/2467854638125225599' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/2467854638125225599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/2467854638125225599'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2009/12/nimble-osgi.html' title='Nimble OSGi'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-6160004803900144214</id><published>2009-03-30T12:00:00.012+01:00</published><updated>2009-03-30T14:00:10.256+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BND"/><category scheme="http://www.blogger.com/atom/ns#" term="EclipseCon"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><category scheme="http://www.blogger.com/atom/ns#" term="PDE"/><category scheme="http://www.blogger.com/atom/ns#" term="Sigil"/><title type='text'>OSGi Dev Con 2009 &amp; OSGi Tooling Summit Roundup</title><content type='html'>So I&#39;m currently sitting in my hotel lobby waiting till we jump in the hire car off to the airport for our flight home. It&#39;s been a long week - the time zone difference between San Francisco and London is always exhausting and the mental effort of networking, presenting, and talking to customers is always pretty intensive too.&lt;br /&gt;&lt;br /&gt;I think the conference was definitely quieter this year - you couldn&#39;t help but feel the shadow of the economic climate hanging over us all - however though volume was down compared to last year, quality seemed to be much higher. My rough market assessment based on talking to people on our exhibition stand was that awareness of OSGi is much improved compared to last year.&lt;br /&gt;&lt;br /&gt;Even better for me people really seemed to get what we (&lt;a href=&quot;http://www.paremus.com/&quot;&gt;Paremus&lt;/a&gt;) are about. Last year we were the &quot;RMI guys&quot;.  This year people we talked to seemed to get genuinely excited about what our product is a really about: a flexible, scalable solution to provisioning and managing dynamic distributed OSGi based applications in enterprise environments.&lt;br /&gt;&lt;br /&gt;Pretty much everyone we talked to was very positive on OSGi as a runtime solution to Java modularisation. However, the problem for its adoption in the enterprise is the backwards compatability issues in moving to an OSGi environment (things like static references and Class.forName are a really bad idea in OSGi) and the fact that OSGi development relies on a reasonable amount of domain specific knowledge.&lt;br /&gt;&lt;br /&gt;I think good tooling solutions that work right the way though the stack are crucial to help new developers though the pitfalls of the new classloader space. Unfortunately, tooling support for new developers is pretty disjointed.&lt;br /&gt;&lt;br /&gt;Hence, the next part of my post...&lt;br /&gt;&lt;br /&gt;We (Paremus) recognised that it does us no good if customers are having difficulty building OSGi based solutions. Therefore, my team mate Derek Baum and I have been working on a solution to developing OSGi bundles which works in both an IDE and headless build environment called &lt;a href=&quot;http://sigil.codecauldron.org/&quot;&gt;Sigil&lt;/a&gt;. Prior to OSGi Dev Con Paremus chose to licence Sigil under the Apache licence, as we recognise that tooling is an area where we need support from the community in order to help the community as a whole.&lt;br /&gt;&lt;br /&gt;On the Friday, after the end of the conference, I and a number of other representatives with interests in the area of development tooling met at an OSGi Tooling Summit hosted by Yan Pujante at &lt;a href=&quot;http://www.linkedin.com/&quot;&gt;LinkedIn&lt;/a&gt;&#39;s Mountain View offices. The group was pretty large and diverse (as you can see &lt;a href=&quot;http://www.osgi.org/Event/20090327&quot;&gt;here&lt;/a&gt;). The OSGi Alliance&#39;s typical role in this respect is to foster communication (via summits, conference calls etc), then generate one or more RFPs which list a set of requirements for the problem domain, and finally put together a set of RFCs which provide a spec to allow different vendors to work together.&lt;br /&gt;&lt;br /&gt;The format of the meeting was an initial intro and positioning statements (i.e. what we were there to achieve). We then moved into a blue sky discussion where we tried to think of a perfect world solution to the OSGi development lifecycle - this stimulated some really interesting conversation which I&#39;ll doubtless follow up on in the next couple of weeks in future blog posts. Finally, we put together a series of use cases headers that captured the major tasks undertaken by developers when building, maintaining and releasing OSGi applications into the wild.&lt;br /&gt;&lt;br /&gt;I had a number of really encouraging conversations with Chris Aniszczyk and Peter Kriens who work on &lt;a href=&quot;http://www.eclipse.org/pde/&quot;&gt;PDE&lt;/a&gt; and &lt;a href=&quot;http://www.aqute.biz/Code/Bnd&quot;&gt;BND&lt;/a&gt; respectively, both of which have a lot of cross over with the work I&#39;ve been doing on Sigil.&lt;br /&gt;&lt;br /&gt;Chris has just &lt;a href=&quot;http://twitter.com/caniszczyk/status/1415416567&quot;&gt;twittered&lt;/a&gt; that he&#39;s thinking of changing the name of PDE to BDE which I think is a great idea - perhaps some merging of BDE, Sigil and BND? I think there is likely some common core classes that are useful to all OSGi developers. We&#39;re obviously going to need some domain specific extensions for plugin development, newton development, spring development, etc. but I see these as addons on top of a common OSGi layer.&lt;br /&gt;&lt;br /&gt;I guess in a perfect world I&#39;d like to be able to support Maven, Netbeans and IntelliJ users as well. Hopefully I&#39;ll be able to update you in the next couple of months on progress in this area.&lt;br /&gt;&lt;br /&gt;Laters,</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/6160004803900144214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/6160004803900144214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/6160004803900144214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/6160004803900144214'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2009/03/osgi-dev-con-2009-osgi-tooling-summit.html' title='OSGi Dev Con 2009 &amp; OSGi Tooling Summit Roundup'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-543020718183627233</id><published>2009-03-18T09:46:00.004+00:00</published><updated>2009-03-18T11:44:58.376+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EclipseCon"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><category scheme="http://www.blogger.com/atom/ns#" term="Sigil"/><title type='text'>Flocking Behaviours</title><content type='html'>&lt;a href=&quot;http://www.eclipsecon.org/2009/&quot;&gt;&lt;img src=&quot;http://www.eclipsecon.org/2009/static/image/100x100_speaking.gif&quot; alt=&quot;I&#39;m speaking at EclipseCon 2009&quot; border=&quot;0&quot; height=&quot;100&quot; width=&quot;100&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Just a quick note to say I&#39;ll be running a BOF session with Peter Kriens and Chris Aniszczyk on OSGi development tooling at EclipseCon this year as part of the OSGi track. You can find details &lt;a href=&quot;http://www.eclipsecon.org/2009/sessions?id=787&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I guess &lt;em&gt;my&lt;/em&gt; main focus for calling the BOF is that I&#39;m very interested in talking to other OSGi developers to see what it is we on the tooling side can do to make our collective jobs easier. &lt;br /&gt;&lt;br /&gt;What is it about OSGi development that really frustrates you - and what can tools do to make it easier?&lt;br /&gt;&lt;br /&gt;It&#39;ll also be really interesting to meet up with other tools developers to see if we can get a bit of reuse going on - likely we won&#39;t solve that in one BOF but if we can just put names to faces and get a bit of shared understanding going on we&#39;re likely to be more productive in the long term.&lt;br /&gt;&lt;br /&gt;Hope to see you there.&lt;br /&gt;&lt;br /&gt;Laters,</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/543020718183627233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/543020718183627233' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/543020718183627233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/543020718183627233'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2009/03/just-quick-note-to-say-ill-be-running.html' title='Flocking Behaviours'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-1185356518651738449</id><published>2009-02-26T11:04:00.004+00:00</published><updated>2009-02-26T11:17:25.618+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ivy"/><category scheme="http://www.blogger.com/atom/ns#" term="Maven"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><category scheme="http://www.blogger.com/atom/ns#" term="Sigil"/><title type='text'>OSGi tooling</title><content type='html'>There&#39;s a really interesting conversation going on at TSS about &lt;a href=&quot;http://www.theserverside.com/news/thread.tss?thread_id=53803#305397&quot;&gt;OSGi and future directions for Enterprise Java&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I&#39;ve posted a reply which I thought it was worth reposting here:&lt;br /&gt;&lt;br /&gt;I think there are two issues with [the approach of repackaging existing modules as OSGi bundles and simply importing/exporting all packages] which really cause headaches going forward; Module vs API dependencies and complex &quot;Uses&quot; graphs.&lt;br /&gt;&lt;br /&gt;Firstly module vs api; in most dependency tools such as Maven and Ivy the developer specifies dependencies at the module layer - i.e.&lt;br /&gt;&lt;br /&gt;&amp;lt;dependency org=&quot;org.apache.log4j&quot; name=&quot;org.apache.log4j&quot; rev=&quot;1.2.15&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;But then spring have added an OSGi version of the module which has a different module id.&lt;br /&gt;&lt;br /&gt;&amp;lt;dependency org=&quot;org.apache.log4j&quot; name=&quot;com.springsource.org.apache.log4j&quot; rev=&quot;1.2.15&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;How does the tooling know that these two modules are actually compatible? It can&#39;t and this tends to lead to false dependency failures. This is the same problem as using module dependencies in OSGi at runtime. Actually the code is not dependent on the module but on the API that the module supplies.&lt;br /&gt;&lt;br /&gt;Having been working with OSGi as part of our [1] distributed OSGi platform for almost 4 years now, I came to the conclusion that the tooling should use the notion of package import at build time - just as OSGi does at runtime. This is the approach I&#39;ve taken in Sigil [2] which we&#39;re now using to build our next product release.&lt;br /&gt;&lt;br /&gt;Having taken the jump to use API dependencies our build system is now much simpler to manage. Instead of having to manually lookup which module supplies a package, I just type the package into the IDE and our tooling goes off and trawls the OSGi manifest information in various repositories to find a module that supports it (seemless). We&#39;ve also used this on a number of third party applications (the record being a project with over 600 modules - which we managed to convert to use sigil in less than a couple of hours based on pretty much a simple grep of the java code for java import statements).&lt;br /&gt;&lt;br /&gt;Secondly the major thorn in the approach of naively exporting all packages in a module is the complex &quot;uses&quot; information it generates. &quot;Uses&quot; is a flag provided by OSGi on exports to assert that the class space is coherent across multiple bundle import/export hops.&lt;br /&gt;&lt;br /&gt;It is currently believed that the &quot;uses&quot; information makes the problem of resolving bundle dependencies NP-complete. As the number of bundles and import/exports increases the number of calculations the OSGi runtime has to do to check that all bundles can sit together goes up at a terrifying rate.&lt;br /&gt;&lt;br /&gt;I&#39;ve referred to this as placing barbed wire around sand castles (in most cases). If the modules were more sensibly designed i.e. only exporting the &quot;really&quot; public code then this problem is much reduced.&lt;br /&gt;&lt;br /&gt;I&#39;m also attending the summit Jason refers to and I&#39;ve called a BOF &quot;OSGi Development Tooling&quot; with Peter Kriens and Chris Aniszczyk at the OSGiDevCon conference just prior to the summit to discuss tooling efforts w.r.t. OSGi. The BOF is open to the general public and it would be great to hear opinions before we sit down at the summit to figure out a path forwards.&lt;br /&gt;&lt;br /&gt;[1] http://www.paremus.com&lt;br /&gt;[2] http://sigil.codecauldron.org</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/1185356518651738449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/1185356518651738449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/1185356518651738449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/1185356518651738449'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2009/02/theres-really-interesting-conversation.html' title='OSGi tooling'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-175324447163800264</id><published>2008-11-27T15:17:00.007+00:00</published><updated>2008-11-28T10:16:52.646+00:00</updated><title type='text'>Coming up for air</title><content type='html'>Ok so it&#39;s been a while since I last post anything here, mainly because I&#39;ve been working on a number of different big projects for the last couple of months and this left no time for blog posting.&lt;br /&gt;&lt;br /&gt;So having come up for air for a few hours at least I thought it&#39;d be a good idea to blog about them see if I can drum up some interest ;)&lt;br /&gt;&lt;br /&gt;The major addition to my task list over the past few months has been the &lt;a href=&quot;http://sigil.codecauldron.org/&quot;&gt;Sigil project&lt;/a&gt;. This is a set of tools to help developers build OSGi bundles. It started off as an eclipse plugin but about two or three months ago my team mate came along with some really great code to integrate it with Ivy.&lt;br /&gt;&lt;br /&gt;I believe Sigil is the first tool out there to unify OSGi development in the IDE and server side build in a common configuration file (this being a good thing as it saves the messy job of keeping other systems in sync).&lt;br /&gt;&lt;br /&gt;The IDE supports tools such as code complete, quick fixes and tools to analyse OSGi dependencies. I&#39;ve also built in the idea of repositories (currently either file system or &lt;a href=&quot;http://www.osgi.org/Repository/HomePage&quot;&gt;OBR&lt;/a&gt; but extensible via plugins) which allow the developer to download dependencies on the fly whilst developing by simply adding an import-package or require bundle statement to their code. Oh and the same repositories can be used in eclipse and ivy :)&lt;br /&gt;&lt;br /&gt;The other big piece of code I&#39;ve been working on is of course &lt;a href=&quot;http://newton.codecauldron.org/&quot;&gt;Newton&lt;/a&gt;. There are no big feature announcements for this release as we&#39;ve been focussing on making the current platform more and more robust. But we&#39;ve just made available the &lt;a href=&quot;http://newton.codecauldron.org/site/download/release-1.3.1.html&quot;&gt;1.3.1 release&lt;/a&gt; which has a number of internal improvements to reliability and scalability - I&#39;d encourage you to take a look - one game we end up playing in the office is &quot;Wak - A - Mole&quot; with the containers when the fractal demo is deployed. You can take out a container (ctrl-c, ctrl-z, power cycle, cable unplug, etc) and the infrastructure will always recover :)&lt;br /&gt;&lt;br /&gt;Anyway that seems like a good amount of detail for the time being. I&#39;ll try to blog some more about some of this stuff soon...&lt;br /&gt;&lt;br /&gt;Laters,</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/175324447163800264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/175324447163800264' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/175324447163800264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/175324447163800264'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2008/11/coming-up-for-air.html' title='Coming up for air'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-7167632212885833570</id><published>2008-07-22T09:16:00.005+01:00</published><updated>2008-07-22T13:26:45.948+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Newton"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><category scheme="http://www.blogger.com/atom/ns#" term="SCA"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><title type='text'>Is this an application which I see before me?</title><content type='html'>This post has been triggered by two &lt;a href=&quot;http://www.osgi.org/blog/2008/07/osgi-application-grouping.html&quot;&gt;interesting&lt;/a&gt; &lt;a href=&quot;http://osgi.mjahn.net/2008/07/21/the-notion-of-an-application-fitting-just-in/&quot;&gt;posts&lt;/a&gt; on the topic of what it is to be an application in an OSGi environment. This is something I felt I just had to get stuck in with as its exactly what we&#39;ve been working on in the &lt;a href=&quot;http://newton.codecauldron.org/&quot;&gt;Newton&lt;/a&gt; project.&lt;br /&gt;&lt;br /&gt;The way we&#39;ve tackled this is very similar to the approach suggested by Mirko, except instead of using Spring-DM as the top level element in the model we&#39;ve picked &lt;a href=&quot;http://www.osoa.org/display/Main/Service+Component+Architecture+Home&quot;&gt;SCA&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;SCA is a relatively new specification but it gives a vendor neutral way of describing the service dependencies and architecture of an application running in an enterprise environment.&lt;br /&gt;&lt;br /&gt;The basic pattern is that a component which has a certain implementation (java, spring, bpel, c, etc) is able to publish a number of services (over a range of protocols - in-memory, RMI, WS, JMS, etc) and consume services from other components via references. The combined unit which is the component, it&#39;s services and it&#39;s references are then packaged in an entity called a composite.&lt;br /&gt;&lt;br /&gt;In Newton we associate a composite with a top level (or root) bundle. This bundle then provides the class space for the composite to instantiate it&#39;s implementation, services and references. Importantly the bundle does not have to contain &lt;span style=&quot;font-style: italic;&quot;&gt;all&lt;/span&gt; of the classes that it needs to function but can use OSGi tools such as Import-Package to achieve modularity at the deployment level.&lt;br /&gt;&lt;br /&gt;When an SCA composite is installed in a Newton runtime we go through a series of steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Resolve the root bundle that supplies the class space for the composite. If this is not the first time the root bundle has been resolved we increment an internal counter&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Resolve and optionally download the bundle dependencies required to satisfy the root bundle against a runtime repository (this includes ensuring that we reuse existing bundles within the runtime - if they were installed for other composites)&lt;/li&gt;&lt;li&gt;Build a runtime model around the SCA document that controls the lifecycle of the component as references come and go&lt;/li&gt;&lt;li&gt;Finally when all required references are satisfied (a dynamic process) we publish the services to be consumed by other components in the enterprise.&lt;/li&gt;&lt;/ol&gt;When an SCA composite is uninstalled we go through the reverse process:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Unpublish the services and release any references.&lt;/li&gt;&lt;li&gt;Shut down the implementation and discard our runtime model.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The bundle root counter is decremented, if the bundle root counter reaches zero then it is no longer required in the runtime and is marked as garbage.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Finally garbage collect all bundles that are no longer in use, so clearing down the environment.&lt;/li&gt;&lt;/ol&gt;This pattern then forms the building blocks of our distributed provisioning framework that is able to deploy instances of SCA composites across what we term a &quot;fabric&quot; of newton runtime instances.&lt;br /&gt;&lt;br /&gt;To achieve this we group composites together into an entity known as a System. A system is a group of composites which each specify a particular replication strategy and a set of contract requirements. A replication strategy is a dynamic pattern used by Newton to decide how many instances of a Composite should be installed at any given instant. A contract is a pattern used to restrict where a composite should be installed, i.e. a contract may specify a filter such as (&amp;amp;(machine.cpu.count&gt;1)(machine.memory&gt;1G)) i.e. only install on dual cpu or greater machines with more than 1GB of memory available.&lt;br /&gt;&lt;br /&gt;So in the Newton world an application is actually a very dynamic entity. It is built from OSGi bundles and wired together on the fly. But it never the less has rules which are defined via a model (expressed in SCA plus our system extensions) which specify:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;how implementations and interfaces are connected&lt;br /&gt;&lt;/li&gt;&lt;li&gt;how remote services should interact via bindings&lt;/li&gt;&lt;li&gt;how they should scale&lt;/li&gt;&lt;li&gt;where they should install&lt;/li&gt;&lt;/ul&gt;Hope that&#39;s been of interest,&lt;br /&gt;&lt;br /&gt;Laters,</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/7167632212885833570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/7167632212885833570' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/7167632212885833570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/7167632212885833570'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2008/07/is-this-application-which-i-see-before.html' title='Is this an application which I see before me?'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-7744614223544215130</id><published>2008-07-02T21:28:00.008+01:00</published><updated>2008-07-03T14:02:26.668+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><title type='text'>A New Hope</title><content type='html'>A long time ago in a galaxy far far away...&lt;br /&gt;&lt;br /&gt;A group of rebels formed the OSGi Alliance, an alliance against the empire (or at least monolithic code empires). The alliance was created to champion an ideal (in CS terms a specification) which described a standardised way for modules of Java code in a single virtual machine to interoperate without requiring the JVM to be restarted.&lt;br /&gt;&lt;br /&gt;The specification was simple to understand and many were drawn to it due to the elegance of its implementation. In time many who chose this new life found that despite the simplicity of the specification championed by the JEDi alliance they could nevertheless wield wondrous powers not seen before in the Java world.&lt;br /&gt;&lt;br /&gt;Inevitably these powers drew the attention of those still living within the empire. Initially some sought to discredit the Jedi powers, either through misunderstanding or fear. But soon others became envious and wanted these powers for themselves.&lt;br /&gt;&lt;br /&gt;Some within the empire chose to take the difficult road and started to convert their legacy methodologies to meet the requirements of the Jedi ideal. But others saw a different path, instead of converting their methodologies to conform to the Jedi ideals they decided to convert the Jedi ideals to fit their own methodologies.&lt;br /&gt;&lt;br /&gt;Those in the Jedi council found themselves torn between the short term promises of wealth offered by the empire or sticking to their ideals and holding out for the long term riches of a truely flexible Java virtual machine architecture.&lt;br /&gt;&lt;br /&gt;It is at this point in the story that we find our selves. Peter Kriens (Obi Wan?) has recently &lt;a href=&quot;http://www.osgi.org/blog/2008/07/qvo-vadimus.html&quot;&gt;blogged&lt;/a&gt; about the choices facing the Jedi alliance and argues for the purist ideals to be upheld.&lt;br /&gt;&lt;br /&gt;Myself I find myself acting as a trader (or possibly a smuggler - gonna argue for Han but you make your own judgements...) between these two worlds.&lt;br /&gt;&lt;br /&gt;As a developer and architect of &lt;a href=&quot;http://www.paremus.com/products/products.html&quot;&gt;Infiniflow&lt;/a&gt; I have been directly involved with building a distributed computing infrastructure that seeks to embrace ways of the Force as championed by the Jedi alliance for a single JVM but across the enterprise.&lt;br /&gt;&lt;br /&gt;Our driving goal that led us as a company to the Jedi way of life was acceptance within our architecture that things change, or to put it another way: there is no one rigid model of the enterprise but rather a series of iterations which encapsulate the functions required to service the current business requirements.&lt;br /&gt;&lt;br /&gt;Whether you believe a word of this, having walked the boundary between the Jedi world and that of the Empire I am acutely aware of the problems associated with integrating tools built by these two communities.&lt;br /&gt;&lt;br /&gt;My own gut feeling is that the Jedi should stick to their ideals and treat integration with the Empire as an edge case - i.e. certainly build up specifications but treat them as boundary conditions vs compromising the core ideals. In this way legacy methodologies can be incorporated but in such a way as to highlight the fact that it is just a stepping stone towards a new ideal.&lt;br /&gt;&lt;br /&gt;When it is impossible to integrate a legacy pattern I&#39;d argue that this is a point when we have to admit that Gödel was right - it is not always possible to please all of the people all of the time (I &lt;a href=&quot;http://en.wikipedia.org/wiki/G%C3%B6del%27s_incompleteness_theorems&quot;&gt;paraphrase&lt;/a&gt; but you get the point). You can always delegate legacy cases to a separate jvm and communicate remotely to the old world.&lt;br /&gt;&lt;br /&gt;If the Jedi council compromise their core ideals for ill conceived or temporary solutions they risk sending out a mixed and confusing message to those who are new to this technology.&lt;br /&gt;&lt;br /&gt;Padawan learning the ways of the Force for the first time are unlikely to appreciate the subtle differences between such abstract concepts as import-package and require-bundle. They will of course go for which ever is the simplest pattern to achieve their short term goals but this could well be at the expense of logical coherency within the OSGi specification.&lt;br /&gt;&lt;br /&gt;Once stepping onto the path to the dark side it is very difficult to turn back and ultimately leads to ruin. (Or cool lightning powers - you decide)&lt;br /&gt;&lt;br /&gt;I have to give credit to the fantastic blog posts of &lt;a href=&quot;http://www.tensegrity.hellblazer.com/&quot;&gt;Hal Hildebrand&lt;/a&gt; for the Star Wars theme to this blog entry, whether this will become a common theme for my own posts I&#39;m unsure but it was certainly fun to write.&lt;br /&gt;&lt;br /&gt;Laters,</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/7744614223544215130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/7744614223544215130' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/7744614223544215130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/7744614223544215130'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2008/07/new-hope.html' title='A New Hope'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-3430458323808230100</id><published>2008-06-10T09:26:00.005+01:00</published><updated>2008-06-10T10:40:42.119+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><title type='text'>To Be(*) Or Not To Be(*) That Is The Question</title><content type='html'>(*) Included in an API bundle.&lt;br /&gt;&lt;br /&gt;There&#39;s been a lively &lt;a href=&quot;http://www.mail-archive.com/osgi-dev@mail.osgi.org/msg00097.html&quot;&gt;debate&lt;/a&gt; on the OSGi mailing list over the past couple of weeks surrounding the issue of whether an API should be packaged with it&#39;s implementation in one bundle or whether it should be split up into two bundles (one for API and one for implementation).&lt;br /&gt;&lt;br /&gt;I think it&#39;s fair to say there are a range of opinions on the subject. What is clear however is that there is no one size fits all answer to this question. As a developer or architect you need to consider the use case your API and implementation are going to be put to in order to make the &quot;correct&quot; decision.&lt;br /&gt;&lt;br /&gt;The fundamental issue that everyone involved in the discussion agreed on is that using a bundle should be as simple as possible. The difference of opinions comes in depending on what measure of simplicity you take to be most important. I think there are three main themes that have so far been discussed:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;installation simplicity - minimizing the number of bundles needed to run an OSGi application&lt;/li&gt;&lt;li&gt;runtime simplicity - minimizing the connectivity between bundles in a running OSGi application.&lt;/li&gt;&lt;li&gt;architectural simplicity - minimizing duplicated packages between bundles used to build an OSGi application&lt;/li&gt;&lt;/ul&gt;These three goals are often (but not always) in conflict and it depends on your use case which is the most important for you. In order understand where the conflict arises it is important to understand how OSGi classloading works especially with regard to installation and resolution of bundles.&lt;br /&gt;&lt;br /&gt;I&#39;ll try to give a quick overview.&lt;br /&gt;&lt;br /&gt;A bundle can contain classes (like any standard Java jar). However it can also import classes from other bundles via a number of different import mechanisms. Importing classes allows bundles to be modularized such that different bundles provided different sets of functionality but still declare their dependencies in order to run. In order to use classes from a bundle all import requirements must be satisfied. In order to satisfy an import requirement a bundle exporting that requirement must be installed in the OSGi runtime.&lt;br /&gt;&lt;br /&gt;So if BundleA depends on classes exported from BundleB you have to install both BundleA and BundleB in order to use BundleA. If BundleB depends on classes from another bundle you need to install those bundles too. You can probably see that this problem can rapidly diverge from being a single bundle install to being a large complicated set of bundle installs.&lt;br /&gt;&lt;br /&gt;Another important detail to be considered is that in OSGi it is possible for many bundles to export the same API package and only one will be picked by the runtime to actually provide the classes.&lt;br /&gt;&lt;br /&gt;When we discuss splitting API and implementation we are saying that one bundle will export the API classes and another bundle will import that API and provide an implementation for it. When we talk about grouping API and implementation we mean that the API will be exported from the same bundle that provides the implementation. Many implementations may export the same API but this is OK in an OSGi framework.&lt;br /&gt;&lt;br /&gt;My own advice would be to start by assuming that API and implementation are packaged in separate bundles. The reasoning behind this is based on the following criteria:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;In general an implementation is likely to depend on more packages than it&#39;s API&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You can always collapse back to one bundle later if you use import-package vs require-bundle&lt;/li&gt;&lt;li&gt;If you use a provisioning mechanism such as &lt;a href=&quot;http://newton.codecauldron.org&quot;&gt;Newton&lt;/a&gt; or &lt;a href=&quot;http://wiki.eclipse.org/Equinox_p2&quot;&gt;P2&lt;/a&gt; (when it&#39;s ready) downloading two bundles vs one is handled automagically&lt;/li&gt;&lt;/ul&gt;The benefits of splitting API and implementation are the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If you are considering making your application distributed or want it to run in a constrained environment you can install the API without having to resolve the implementation dependencies (possibly a &lt;span style=&quot;font-style: italic;&quot;&gt;big deal&lt;/span&gt; in a client/server architecture)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you want to restart or reinstall the implementation bundle then this doesn&#39;t automatically mean the restart of all client bundles that are using the API from that bundle&lt;br /&gt;&lt;/li&gt;&lt;li&gt;OSGi export-package has a uses attribute - to specify classes that the exported API has gained from imports. It is possible for combinations of exports and imports to cause bundles to be mutually exclusive - such that it is impossible to close the graph and install all bundles in the same OSGi runtime at the same time. Limiting the connectivity in the graph via separating API from implementation reduces the risk of running into this problem.&lt;/li&gt;&lt;/ul&gt;If you start by assuming the API and implementation are separate then you can use the following logic to assess whether you can condense them back to one bundle for the purposes of your architecture:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Start by designing your API to depend on as little as possible.&lt;/li&gt;&lt;li&gt;Make your implementation depend on API packages and any other dependencies it needs to function.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If after doing this the implementation depends only on API consider whether the implementation is ever likely to get more complicated.&lt;/li&gt;&lt;li&gt;If it isn&#39;t then you can probably collapse back to one bundle.&lt;/li&gt;&lt;/ol&gt;Of course this  can always be done prior to building &lt;i class=&quot;moz-txt-slash&quot;&gt;&lt;span class=&quot;moz-txt-tag&quot;&gt;&lt;/span&gt;any&lt;span class=&quot;moz-txt-tag&quot;&gt;&lt;/span&gt;&lt;/i&gt; bundles if you are good at  modelling in you head or on paper etc.&lt;br /&gt;&lt;br /&gt;Hopefully that&#39;s helped some people understand the issues.&lt;br /&gt;&lt;br /&gt;Laters</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/3430458323808230100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/3430458323808230100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/3430458323808230100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/3430458323808230100'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2008/06/to-be-or-not-to-be-that-is-question.html' title='To Be(*) Or Not To Be(*) That Is The Question'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-3723734383144130706</id><published>2008-06-08T09:48:00.004+01:00</published><updated>2008-06-09T11:25:19.176+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="JSR277"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><title type='text'>Software Versioning Is Complex Or Am I Imagining It?</title><content type='html'>So it seems everyone and his dog are talking about versioning at the moment. Specifically the proposed version numbering systems used in &lt;a href=&quot;http://www.osgi.org/blog/2008/05/is-9903520300447984150353281023-too.html&quot;&gt;OSGi&lt;/a&gt; and &lt;a href=&quot;http://weblogs.java.net/blog/stanleyh/archive/2008/05/versioning_in_t_1.html&quot;&gt;JSR 277&lt;/a&gt; and their ability to coexist (or not).&lt;br /&gt;&lt;br /&gt;For my own part I personally favor the OSGi scheme because to my mind it is simpler and better defined.&lt;br /&gt;&lt;br /&gt;The OSGi scheme says that there are three numbers used in a version, major.minor.micro -&gt; 1.2.1. The micro version is incremented when ever there are bug fixes. The minor version is incremented when there are backwards compatible additions and the major version is incremented when there are any non backwards compatible changes. It is also possible to add postfix elements to an OSGi version i.e. 1.2.1_20080608 (todays date appended). These postfix elements are considered lexicographically to mean increments/improvements which do not warrant a version update - i.e. nightly builds etc.&lt;br /&gt;&lt;br /&gt;When a module consumer wishes to specify a version they wish to use they specify either a single version number.&lt;br /&gt;&lt;br /&gt;1.0.0&lt;br /&gt;&lt;br /&gt;or a version range&lt;br /&gt;&lt;br /&gt;[1.0.0,2.0.0)&lt;br /&gt;&lt;br /&gt;The first version means any version greater or equal to 1.0.0. The second means any version between 1.0.0 and any version prior to 2.0.0.&lt;br /&gt;&lt;br /&gt;However anyone who has worked with software development for any non trivial amount of  time will know there are still inherent problems in versioning schemes in that they require developers to correctly markup when changes to their code effect the compatibility of that code.&lt;br /&gt;&lt;br /&gt;This is a &lt;span style=&quot;font-style: italic;&quot;&gt;big deal&lt;/span&gt; as depending on the consumer of the code even changes as innocuous as a java doc comment update can effect the version number. There&#39;s a really good discussion of the issues surrounding this &lt;a href=&quot;http://wiki.eclipse.org/Evolving_Java-based_APIs_2&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;As we all know developers are mostly human and so; make mistakes, are lazy or are just plain forgetful so it is inevitable that version numbers will sometimes not be updated when they should have been.&lt;br /&gt;&lt;br /&gt;After release these badly versioned modules (poison pills) will sit around in software repositories for potentially a very long time causing instabilities in the systems that use them.&lt;br /&gt;&lt;br /&gt;Stanly Ho&#39;s &lt;a href=&quot;http://weblogs.java.net/blog/stanleyh/archive/2008/05/versioning_in_t.html&quot;&gt;suggestion&lt;/a&gt; for combating this issue is to allow consumers of modules to specify complex lists which select certain version ranges but exclude certain known bad versions.&lt;br /&gt;&lt;br /&gt;Like many other aspects of his proposal I think this is going to be overly complex and unmanageable in any practical environment. It effectively means build managers have to rebuild their module every time they find a bad module which is a lot of extra work, let alone how the build manager then propagates his/her updated module to all clients.&lt;br /&gt;&lt;br /&gt;OK so what&#39;s the point I&#39;m getting to? Well during discussions with colleagues it occurred to me there is a relatively simple extension we could make to version numbering schemes that nips off a lot of the problems at the start of the development life cycle vs at the end.&lt;br /&gt;&lt;br /&gt;This is a good thing as if it is easier for developers to handle version numbering there should be fewer bad versions.&lt;br /&gt;&lt;br /&gt;I&#39;m not saying there will be no bad versions as there are always the unintended API changes which slip past quality control etc but I would argue these are the exception vs the rule in a well managed project. Any bad versions that do slip out could be highlighted and deleted from the collective repositories by administrators. But given a smaller number of mistakes this problem should be tractable.&lt;br /&gt;&lt;br /&gt;I&#39;ll prefix the rest of this blog entry by saying my idea is a little crazy so please bare with me, pat me on the head and say there, there back to the grind stone you&#39;ll get over it :)&lt;br /&gt;&lt;br /&gt;So enough pontificating, &lt;span style=&quot;font-weight: bold;&quot;&gt;the idea&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;It occurred to me that software versions should really carry an imaginary coefficient (i.e. square root of minus one).&lt;br /&gt;&lt;br /&gt;[Sound of various blog readers falling off their seats]&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;What the hell does that mean I here you ask.&lt;br /&gt;&lt;br /&gt;I said it was crazy and I&#39;m only half proposing it as a real (chuckle) solution. However to my mind it seems more natural to label versions intended as release candidates or as development code as having an imaginary coefficient.&lt;br /&gt;&lt;br /&gt;The reasoning behind this is that whilst development code is tending towards a real API or implementation there are always going to be aspects to it that is not quite finished and so can be considered imaginary. I think a useful way of visualising this is that as software approaches release the imaginary coefficient gets smaller, i.e. there is a rotation in the software from the imaginary plane to the real.&lt;br /&gt;&lt;br /&gt;Ok so just because it has a nice analogy doesn&#39;t make it valid, how does this help in real world software development?&lt;br /&gt;&lt;br /&gt;Firstly this scheme does not effect existing versioning semantics, if you want to work purely in the real plane then that is perfectly acceptable. So it doesn&#39;t break existing OSGi bundle versions in the wild today. However, it does give developers a way to markup whether they want their code to interact with code that is still in development.&lt;br /&gt;&lt;br /&gt;Imagine a case where software producer A (providing module A) is building release candidates and software consumer B is building module B that depends on module A:&lt;br /&gt;&lt;br /&gt;ModuleA:1.0.0_RC1&lt;br /&gt;ModuleA:1.0.0_RC2&lt;br /&gt;ModuleA:1.0.0_RC3&lt;br /&gt;etc.&lt;br /&gt;&lt;br /&gt;ModuleB:import ModuleA:1.0.0&lt;br /&gt;&lt;br /&gt;In the current scheme there is no way to distinguish release candidates from final code and incremental patches so when producer A builds his release candidate consumer B sees each release candidate as actually being more advanced than the final 1.0.0 release.&lt;br /&gt;&lt;br /&gt;This is clearly wrong.&lt;br /&gt;&lt;br /&gt;As software engineers we tend to manage this internally by having a succession of 0.9, 0.9.1, 0.9.2, etc releases prior to the 1.0.0 RC releases so minimizing the number of RC candidates that ever get released and making it relatively simple to tidy up any that do accidentally make it into live environments.&lt;br /&gt;&lt;br /&gt;However this breaks the simple rules set up in the OSGi scheme in that there is a discontinuity between 0.8 and 0.9 that may be non backwards compatible. We then have to employ all sorts of artificial rules during development to say import [0.0.0,0.9.0) but this needs to be applied to all modules &lt;span style=&quot;font-style: italic;&quot;&gt;after&lt;/span&gt; we have decided to make 0.9 the non backwards compatible internal release.&lt;br /&gt;&lt;br /&gt;Instead I propose that when producer A starts work on a set of changes to module A he increments the appropriate version element (depending on the scale of the changes he/she is making) early and adds an imaginary coefficient to mark it in development.&lt;br /&gt;&lt;br /&gt;Therefore from the previous example we have&lt;br /&gt;&lt;br /&gt;ModuleA:1.0.0_3i (RC1)&lt;br /&gt;ModuleA:1.0.0_2i (RC2)&lt;br /&gt;ModuleA:1.0.0_1i (RC3)&lt;br /&gt;&lt;br /&gt;As an external consumer of module A we are then able to use [1.0.0,2.0.0) to mean all compatible increments. An internal consumer prior to release can say [1.0.0_2i,2.0.0)&lt;br /&gt;to mean all releases of module A after RC2. Importantly this will continue to work after release with no need to update existing imports.&lt;br /&gt;&lt;br /&gt;But (I here you say) how do we know how far away from zero to start when starting the imaginary coefficient. I would argue that this can be handled in the same way as real versions i.e. 1.0.0_0.1i is closer to release than 1.0.0_1i and 1.0.0_0.0.1i is closer still. So this issue is likely project or problem specific - start where ever you like.&lt;br /&gt;&lt;br /&gt;We &lt;span style=&quot;font-style: italic;&quot;&gt;could&lt;/span&gt; come up with a scheme where by the major.minor.micro elements of the imaginary coefficient denote degrees of confidence as to how closely the code matches the proposed design - i.e. major = zero -&gt; developer tested, minor = zero -&gt; system tested, micro = zero -&gt; beta tested etc.&lt;br /&gt;&lt;br /&gt;The notion of complex version numbers applies equally to the JSR 277 four number version scheme which to my thinking is a completely pointless addition to a spec which does nothing to address the actual problem and breaks lots of existing code that was previously working fine.&lt;br /&gt;&lt;br /&gt;I&#39;d be very happy for someone to come along and state why imaginary version numbers are not needed as in general I prefer to reuse existing tools where possible and ideally the simplest tool that does the job.&lt;br /&gt;&lt;br /&gt;So if nothing else this is a vote for OSGi versioning but with a couple of notes on how we &lt;span style=&quot;font-style: italic;&quot;&gt;may&lt;/span&gt; be able to improve it.&lt;br /&gt;&lt;br /&gt;Laters&lt;br /&gt;&lt;br /&gt;Update: 09/06/2008&lt;br /&gt;Apologies I linked to the second part of the eclipse article on version updates by mistake the correct link is &lt;a href=&quot;http://wiki.eclipse.org/Evolving_Java-based_APIs&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/3723734383144130706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/3723734383144130706' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/3723734383144130706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/3723734383144130706'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2008/06/software-versioning-is-complex-or-am-i.html' title='Software Versioning Is Complex Or Am I Imagining It?'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4562329366943275783.post-2239029585396932949</id><published>2008-06-07T13:19:00.000+01:00</published><updated>2008-06-07T14:02:12.811+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="JSR277"/><category scheme="http://www.blogger.com/atom/ns#" term="OSGi"/><title type='text'>A JSR To Far?</title><content type='html'>So there&#39;s a lot of conversation going on around the both &lt;a href=&quot;http://ianskerrett.wordpress.com/2008/06/05/the-politics-of-osgi-and-jsr-277/&quot;&gt;the&lt;/a&gt; &lt;a href=&quot;http://www.tensegrity.hellblazer.com/2008/06/my_dinner_with_andre_1.html&quot;&gt;politics&lt;/a&gt; and the &lt;a href=&quot;http://weblogs.java.net/blog/stanleyh/archive/2008/05/versioning_in_t_1.html&quot;&gt;technological&lt;/a&gt; &lt;a href=&quot;http://www.osgi.org/blog/2008/05/is-9903520300447984150353281023-too.html&quot;&gt;issues&lt;/a&gt; surrounding JSR 277. Personally I think the spec is doomed if it doesn&#39;t start working much more closely with the OSGi community - and here&#39;s why.&lt;br /&gt;&lt;br /&gt;The OSGi community now comprises almost all the major software vendors who have been expending significant effort working on the OSGi specifications and OSGi enabling their applications over a number of years. The JSR is currently stalled and taking advice predominantly from Sun internal researchers. &lt;br /&gt;&lt;br /&gt;If JSR 277 makes it into the Java 7 release then it seems entirely plausible that the major vendors &lt;span style=&quot;font-style:italic;&quot;&gt;could&lt;/span&gt; choose not to certify their products on Java 7 (especially if the JSR gets in the way of their existing investment in OSGi).&lt;br /&gt;&lt;br /&gt;Where would this leave Sun if the likes of Websphere, Weblogic, Spring, etc, etc are not certified to run in an enterprise environment? Also where does it leave Java?&lt;br /&gt;&lt;br /&gt;Disclaimer, these are my own interpretations of the situation and I have had no conversations with any of the protagonists leading me to this assessment. I&#39;m just concerned that politics and egos seem to be getting in the way of one of the most important evolutions of the Java eco system which could be a disaster for all involved in Java. &lt;br /&gt;&lt;br /&gt;Please guys, set egos aside and come to a sensible decision that allows us all to get on with our day jobs.</content><link rel='replies' type='application/atom+xml' href='http://chronological-thought.blogspot.com/feeds/2239029585396932949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4562329366943275783/2239029585396932949' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/2239029585396932949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4562329366943275783/posts/default/2239029585396932949'/><link rel='alternate' type='text/html' href='http://chronological-thought.blogspot.com/2008/06/jsr-to-far.html' title='A JSR To Far?'/><author><name>David Savage</name><uri>http://www.blogger.com/profile/15265941194168751506</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_qZSgDwif2Js/SEp8dPbHQlI/AAAAAAAAAAQ/uIcMp6kIzLA/S220/Photo+12.jpg'/></author><thr:total>0</thr:total></entry></feed>