<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-18772002</id><updated>2008-08-25T17:18:14.406Z</updated><title type='text'>OSGi Alliance Blog</title><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default?start-index=26&amp;max-results=25'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml'/><author><name>OSGi Alliance</name><uri>http://www.blogger.com/profile/03796133538243294756</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>116</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-18772002.post-8947281361750234089</id><published>2008-08-25T16:27:00.003Z</published><updated>2008-08-25T17:18:14.523Z</updated><title type='text'>Why Services are Important</title><content type='html'>Many people choose OSGi because it provides them with far superior class loading functions than plain Java. Some even say that OSGi is class loaders on steroids. However, viewing OSGi from this perspective is like building a car that looks like a horse carriage with engine. Taking full advantage of OSGi requires the use of services, however, the service model is much more enigmatic for most people than class loading. A good friend of mine, &lt;a href="http://niclasnilsson.se/"&gt;Niclas Nilsson&lt;/a&gt;, who visited me last week told me a story about how people view software languages in a very subjective way. If the languages they are familiar with do not have a specific feature, then they have a tendency to view this feature as unimportant and consider them (unnecessary) &lt;em&gt;syntactic sugar&lt;/em&gt;. For example, few Basic programmers missed objects in the nineties.&lt;br /&gt;I think services are a bit like this. There are millions very experienced Java programmers that build impressive libraries and applications using class loaders as extension mechanisms. There is a wealth of knowledge and experience. In contrast, OSGi services implement a concept where one cannot find a comparable mechanism in plain Java, nor in other languages/environments.&lt;br /&gt;&lt;br /&gt;Why are services then so important if so many applications can be built without them? Well, services are the best known way to decouple software components from each other. And, I assume that you are aware of the many advantages that decoupling gives you in almost any aspect of software development.&lt;br /&gt;&lt;br /&gt;One of the most important aspects of services is that they significantly minimize class loading problems because they work with &lt;em&gt;instances&lt;/em&gt; of objects, not with class names. Instances that are created by the provider, not the consumer. The reduction of the complexity is quite surprising. Simple example is Hibernate; most of the class loading problems in Hibernate are caused by the fact that the configuration is done in XML files. Working with Class instances and instances of those classes make most problems go away.&lt;br /&gt;&lt;br /&gt;What kind of problems do you have with the class names? Well, first you have to configure it. This means that if you want to change the implementation, you must not only edit some (hard to read) XML or properties file, you must also make sure that the right JAR files are on your class path. In a service based system, you only install the proper bundle. Look at the 'interesting' world of logging in Java. Most logging subsystems handle their extension needs with class names. This requires having property or XML files in the right place and requires you to have the right logger implementation on your JAR path. In an OSGi world, the only thing you have to do is install an implementation of the log service and everybody uses that log service. As Richard Hall always says: 'The set of installed bundles is your configuration.'&lt;br /&gt;&lt;br /&gt;Not only do services minimize configuration, they also significantly reduce the number of shared packages. In Class.forName based system you need to be able to see all possible implementation classes. In a service based system, you only need to see the package in which the service is defined. And the best package is one that is not shared.&lt;br /&gt;&lt;br /&gt;To be honest, after working for many years with OSGi I really had to get used to the idea that one could also share packages with implementation code; before R4 OSGi was only intended to share service packages. It seemed such a bad idea.&lt;br /&gt;&lt;br /&gt;Sharing implementation classes is almost always bad because it makes bundles extremely dependent on each other. The reason we added all those powerful class loading mechanisms was not for them to be used in new designs, their primary purpose was to ease conversion of existing applications.&lt;br /&gt;&lt;br /&gt;And last not least: versioning. Class.forName must fundamental flaw is that the only parameter is a string for the class name. In complex systems there will be multiple classes with the same name. This confusion is completely absent in a service based system because service objects are already correctly wired up.&lt;br /&gt;&lt;br /&gt;However, I guess there is no escape to Niclas' story. If you have never built a real system with services it is hard to see the advantages and it is easy consider them as an extra without a lot of value. But, maybe this blog can give you the push to start using services in real designs and find out how surprisingly powerful this very simple concept is. Let me know!&lt;br /&gt;&lt;br /&gt; &lt;a href="http://www.blogger.com/www.aQute.biz"&gt;Peter Kriens&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/08/why-services-are-important.html' title='Why Services are Important'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=8947281361750234089&amp;isPopup=true' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/8947281361750234089'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/8947281361750234089'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-7119206641964097211</id><published>2008-08-05T16:58:00.005Z</published><updated>2008-08-06T11:47:31.302Z</updated><title type='text'>Classy Solutions to Tricky Proxies</title><content type='html'>Though the quest for reusable systems is the guiding principle in my life, I only recently start to understand the reason for some of the mechanisms in Spring. For example, I start to see that the whole Aspect Oriented Programming (AOP) business is not about aspect oriented programming, but it is about hammering an existing code base into its intended slot. Unfortunately, some of the slots are square while the code bases are quite round. Therefore, proxying is an important aspect of developing a system by making a round object look square, or vice versa.&lt;br /&gt;&lt;br /&gt;The bad news is that OSGi is not making this easier. The OSGi framework was designed with green field applications in mind that would follow proper modularity rules and communicate through services. In a perfect OSGi world, bundles are highly cohesive and are coupled through their services. In the real world, class loaders are (ab)used for configuration and ad-hoc plugin systems. Some of those problems are quite complex.&lt;br /&gt;&lt;br /&gt;Today, I was asked about the following problem.&lt;br /&gt;&lt;br /&gt;A company is using Spring. One of their bundles referred to a service that another bundle had registered. Spring has decided that services are too jumpy, so they proxy the service object for their clients and add some &lt;em&gt;mixins&lt;/em&gt; in the proxy that handle the situations when a service goes away (Spring also adds some other mixins). &lt;br /&gt;&lt;br /&gt;Creating a proxy is class loader magic. You take a set of interfaces (the mixins) and generate the byte codes for a class that implements all these interfaces. The implementation of the interface methods forwards the call to a &lt;em&gt;handler&lt;/em&gt; object using the object, the method that was called and the arguments. &lt;br /&gt;&lt;br /&gt;If you generate the byte codes for a class, you need to define this class in a class loader and this is where the modularity comes into play. In a traditional Java application you can just take the application class loader and define this new class in this class loader. The application class loader usually has full visibility. In a modular system, however, visibility is restricted to what you need to see. In OSGi, the imported packages are all a bundle can see (at least, when you want to work modular and not use dynamic imports buddy class loading).&lt;br /&gt;&lt;br /&gt;The catch is that the proxy requires access to all the mixin classes. However, some of these mixin classes come from one bundle, and some come from another bundle. There is likely no class loader that can see both bundle class spaces unless that bundle specifically imports the correct interfaces. However, if a client bundle gets one of his objects proxified, then he has no knowledge of the mixins (that is the whole idea). It would be fundamentally wrong to import the interface classes while he is oblivious of them. However, the bundle that generates the proxy might know the mixin classes but it is unlikely it knows the classes of the target object. If the proxy generator was implemented as a service (as it should be) then there would even be 3 bundles involved: the proxy generator, the bundle needing the proxy, and the client bundle.&lt;br /&gt;&lt;br /&gt;Spring solved this problem with a special class loader that chained the class loader from the client bundle together with the class loader of the Spring bundle. They made the assumption that the Spring bundle would have the proper imports for the mixin classes it would provide and the client bundle would have knowledge of the proxied object's classes.&lt;br /&gt;&lt;br /&gt;So all should work fine? Well obviously not or I would not write this blog.&lt;br /&gt;&lt;br /&gt;The generated proxy class can see the Spring bundle with the interface classes and it can see the all the classes that the client bundle can see. In the following picture, the client bundle imports the service interface from package p, but it does not import package q which is used in package p. If you create a proxy for a class in package p, it will need access to package q, and the client bundle can not provide this.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;img src="http://www.osgi.org/wiki/uploads/Blog/visibility.gif"/&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;For example, assume the following case:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  javax.swing.event.DocumentEvent de =&lt;br /&gt;          (DocumentEvent) Proxy.newProxyInstance(getClass().getClassLoader(),&lt;br /&gt;          new Class&lt;&gt;[]{DocumentEvent.class}, this );&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The &lt;code&gt;DocumentEvent&lt;/code&gt; is from the &lt;code&gt;javax.swing.event&lt;/code&gt; package. However, it uses classes from the &lt;code&gt;javax.swing.text&lt;/code&gt; package. Obviously the &lt;a href="http://www.aQute.biz/Code/Bnd"&gt;bnd&lt;/a&gt; tool correctly calculates the import for the &lt;code&gt;DocumentEvent&lt;/code&gt; class. However, when the generated proxy class is instantiated, it will need access to all the classes that the &lt;code&gt;DocumentEvent&lt;/code&gt; refers to: the super class, classes used as parameters in method calls, exceptions thrown, etc. These auxiliary classes are crucial for the &lt;code&gt;DocumentEvent&lt;/code&gt; class, but they are irrelevant for the client bundle, unless these classes are actually used in the client bundle, where they would be picked up by bnd. &lt;br /&gt;&lt;br /&gt;So, if the client bundle does not import &lt;code&gt;javax.swing.text&lt;/code&gt; then you will get a ClassDefNotFoundError when you try to instantiate the proxy class. This error gets generated when the VM sees the reference to class in the &lt;code&gt;javax.swing.text&lt;/code&gt; package and tries to load it through the proxy class' class loader (that is why this is an error, it happens deep down in the VM).&lt;br /&gt;&lt;br /&gt;To be specific, this is exactly as it should be in a proper modular system. The client should not be required to import classes that it does not need. The onus is on the proxy generating code to do it right.&lt;br /&gt;&lt;br /&gt;Fortunately, the solution is not that hard but it highlights how easy it is to make the wrong assumption, believe me, these Spring guys are quite clever. &lt;br /&gt;&lt;br /&gt;Just take a step back and look at the problem. &lt;br /&gt;&lt;br /&gt;Do we need visibility on the bundle level here? Look at the information given to the proxy generator: a set of mixin classes. It does not really matter from what bundle these interfaces classes come from; the class loader that we need must be able to see &lt;em&gt;each&lt;/em&gt; of the interface classes class loaders. By definition, those class loaders can see the right class space.&lt;br /&gt;&lt;br /&gt;So instead of chaining the &lt;em&gt;bundle class loaders&lt;/em&gt;, the problem can be solved by having a class loader that searches each of the class loaders of the used mixin classes. &lt;br /&gt;&lt;br /&gt;&lt;h2&gt;For the Advanced&lt;/h2&gt;&lt;br /&gt;The sketched model is too simplistic because there is the cost of a class loader per generated proxy. Even though enterprise developers seem to live in a wonderful world where memory is abundant, as an old embedded geezer such abuse of class loaders worries me. Though it is possible to use a single combined class loader by keep adding the required class loaders but this raises the question of life cycle. Such an über class loader would pin an awful lot of bundle class loaders in memory and it will be very hard to not run into class space consistency problems because over time this class loader will see all class spaces. That is, this approach brings us back to all the problems of today's application servers.&lt;br /&gt;&lt;br /&gt;I have not tried this, but the solution is likely to make the proxy generator &lt;em&gt;service&lt;/em&gt; based. Not only will this make it easier to plugin different generators, it also means that the generator is bundle aware. It can then create a combining class loader for each bundle that uses the Proxy Generator service. This class loader will then be associated with the class space of that bundle and should therefore not be polluted with classes from other class spaces. In the Spring case, this would be the client bundle, not the spring bundle. The reason is, is that the spring bundle could be used from different class spaces.&lt;br /&gt;&lt;br /&gt;However, the proxy generator must track any bundle that it depends on. That is, it must find out which bundle's export the interface classes and track their life cycle. If any of these bundles stop, it must clear the client's combining  class loader and create a new one when needed. This will allow the classes from the stopped bundle to be garbage collected.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.aQute.biz"&gt;Peter Kriens&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For the hard core aficionados, some code that demonstrates the problem:&lt;br /&gt;&lt;br /&gt;First a base class that acts as activator. This base class calls a createProxy method in the start method. This is then later extended with a proxy generation method that fails and one that works ok.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package aQute.bugs.proxyloaderror;&lt;br /&gt;import java.lang.reflect.*;&lt;br /&gt;import javax.swing.event.*;&lt;br /&gt;import org.osgi.framework.*;&lt;br /&gt;&lt;br /&gt;public abstract class ProxyVisibility implements BundleActivator,&lt;br /&gt;        InvocationHandler {&lt;br /&gt;&lt;br /&gt;    public void start(BundleContext context) throws Exception {&lt;br /&gt;        try {&lt;br /&gt;            DocumentEvent de = createProxy(this, DocumentEvent.class);&lt;br /&gt;            System.out.println("Succesfully created proxy " + de.getClass());&lt;br /&gt;        } catch (Throwable e) {&lt;br /&gt;            System.out.println("Failed to create proxy" + e);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void stop(BundleContext context) throws Exception {&lt;br /&gt;        // TODO Auto-generated method stub&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public Object invoke(Object proxy, Method method, Object[] args)&lt;br /&gt;            throws Throwable {&lt;br /&gt;        return null;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    abstract protected &lt;T&gt; T createProxy(InvocationHandler handler,&lt;br /&gt;            Class&lt;T&gt; primary, Class&lt;?&gt;... remainder);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The following class uses the base activator but uses only the client bundle's class loader. Trying to create the proxy will therefore fail because this class loader can not see the javax.swing.text package.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package aQute.bugs.proxyloaderror;&lt;br /&gt;import java.lang.reflect.*;&lt;br /&gt;&lt;br /&gt;public class ProxyLoadError extends ProxyVisibility {&lt;br /&gt;&lt;br /&gt;    @SuppressWarnings("unchecked")&lt;br /&gt;    public &lt;T&gt; T createProxy(InvocationHandler h, &lt;br /&gt;        Class&lt;T&gt; primary, Class&lt;?&gt;... others) {&lt;br /&gt;&lt;br /&gt;        Class&lt;?&gt; parms[] = new Class&lt;?&gt;[1 + others.length];&lt;br /&gt;        parms[0] = primary;&lt;br /&gt;        System.arraycopy(others, 0, parms, 1, others.length);&lt;br /&gt;&lt;br /&gt;        return (T) Proxy.newProxyInstance(getClass().getClassLoader(), parms,&lt;br /&gt;                h);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And at last, the solution. The following class extends the base activator and creates a proxy that uses a Combined Class Loader. This loader traverses all the class loaders of the mixin classes.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package aQute.bugs.proxyloaderror;&lt;br /&gt;import java.lang.reflect.*;&lt;br /&gt;import java.lang.reflect.Proxy;&lt;br /&gt;import java.net.*;&lt;br /&gt;import java.util.*;&lt;br /&gt;&lt;br /&gt;public class ProxyLoadOk extends ProxyVisibility {&lt;br /&gt;    &lt;br /&gt;    @SuppressWarnings("unchecked")&lt;br /&gt;    public &lt;T&gt; T createProxy(InvocationHandler h, Class&lt;T&gt; primary,&lt;br /&gt;            Class&lt;?&gt;... others) {&lt;br /&gt;        CombinedLoader loader = new CombinedLoader();&lt;br /&gt;&lt;br /&gt;        Class&lt;?&gt; parms[] = new Class&lt;?&gt;[1 + others.length];&lt;br /&gt;        parms[0] = primary;&lt;br /&gt;        System.arraycopy(others, 0, parms, 1, others.length);&lt;br /&gt;        for (Class&lt;?&gt; c : parms) {&lt;br /&gt;            loader.addLoader(c);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return (T) Proxy.newProxyInstance(loader, parms, h);&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    static class CombinedLoader extends ClassLoader {&lt;br /&gt;        Set&lt;ClassLoader&gt; loaders = new HashSet&lt;ClassLoader&gt;();&lt;br /&gt;&lt;br /&gt;        public void addLoader(ClassLoader loader) {&lt;br /&gt;            loaders.add(loader);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public void addLoader(Class&lt;?&gt; clazz) {&lt;br /&gt;            addLoader(clazz.getClass().getClassLoader());&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public Class&lt;?&gt; findClass(String name) throws ClassNotFoundException {&lt;br /&gt;            for (ClassLoader loader : loaders) {&lt;br /&gt;                try {&lt;br /&gt;                    return loader.loadClass(name);&lt;br /&gt;                } catch (ClassNotFoundException cnfe) {&lt;br /&gt;                    // Try next&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            throw new ClassNotFoundException(name);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public URL getResource(String name) {&lt;br /&gt;            for (ClassLoader loader : loaders) {&lt;br /&gt;                URL url = loader.getResource(name);&lt;br /&gt;                if (url != null)&lt;br /&gt;                    return url;&lt;br /&gt;            }&lt;br /&gt;            return null;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/08/classy-solutions-to-tricky-proxies.html' title='Classy Solutions to Tricky Proxies'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=7119206641964097211&amp;isPopup=true' title='3 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/7119206641964097211'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/7119206641964097211'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-7778740184334737724</id><published>2008-08-04T12:06:00.004Z</published><updated>2008-08-04T12:52:39.798Z</updated><title type='text'>Sun Hires Richard Hall</title><content type='html'>It took sometime but yesterday it was official: Sun has hired Richard Hall in the Glassfish team! This is good news for Richard, who was looking for just a position like that, Sun, who can clearly use the expertise on OSGi that Richard as one of the foremost OSGi experts provides, Apache Felix because this means that Richard will be able to spend more time on this project, and also good news for the OSGi Alliance that will have one of its key expert group members represent Sun. Rarely is a change positive in so many ways.&lt;br /&gt;&lt;br /&gt;I look forward to continue working with Richard in his new role. I hope that Richard's role will mean that Glassfish will become one of the key players in the next OSGi release, they clearly have the experience to match. Though it will be interesting to find out what happens in JSR 277 because Richard is currently an independent member. Will he continue to participate (though participate is a big word with the activity in the last year) or will he be able to actively work in that group (and get the long overdue EDR2 out)? That is still a question mark.&lt;br /&gt;&lt;br /&gt;I wish Sun and Richard a very happy and fruitful cooperation and hope to be able to work with Richard for a long time.&lt;br /&gt;&lt;br /&gt;    &lt;a href="http://www.aQute.biz"&gt;Peter Kriens&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/08/sun-hires-richard-hall.html' title='Sun Hires Richard Hall'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=7778740184334737724&amp;isPopup=true' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/7778740184334737724'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/7778740184334737724'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-5742308873045641620</id><published>2008-07-17T07:17:00.002Z</published><updated>2008-07-17T09:13:38.643Z</updated><title type='text'>OSGi Application Grouping</title><content type='html'>Several people in and outside the OSGi want application grouping. They want to be able to deploy a set of bundles as an "application". These "applications" should have some scoping on class loading and service issues. I am opposed to this but, as Eric Newcomer pointed out to me last week in Dublin, I never really made my case and shown a solution to some of the valid requirements. So, here it is ...&lt;br /&gt;&lt;br /&gt;Back to basics. In the beginning, OSGi was about providing functionality to a device. Adding bundles would add more functions and removing bundles would get rid of those functions. Key was that these bundles would collaborate, they would not just be started and running in some silo container; ignorant of their siblings around them. However, these bundles would not have a priori knowledge of each other because the business idea was that different service providers would supply them independently.&lt;br /&gt;&lt;br /&gt;The only way you can make this work is if you have a communication model that allows you to &lt;i&gt;very&lt;/i&gt; loosely couple the bundles. This was the &lt;i&gt;service model&lt;/i&gt;. The service model is very simple: the producer registers some object under an interface and the consumer gets it through the interface. The implementation is safely hidden, the consumer has no clue. Unfortunately, this service model required rules about class loading because those service interfaces involve classes and you better make sure that the producer and the consumer both share the same class loader for that interface/class. It was never the original intention to share implementation classes between bundles because bundles were supposed to communicate through services with a minimal interface to promote loose coupling. Sharing implementation classes was more or less an unintended side effect. Prior to R4 we could not even support multiple versions of the same exported package because that need is not very acute in a service oriented world program.&lt;br /&gt;&lt;br /&gt;In the meantime at plain Java, the poor man's extension model became Class.forName. Where the OSGi model offers the services to the consumer, in the poor man's model the consumer creates the services through dynamic class loading, albeit with the indirection of some XML or other text file. This, alas, requires implementation visibility into the provider bundle. &lt;br /&gt;&lt;br /&gt;The popularity of this Class.forName extension model makes the OSGi class loaders on steroids the most attractive aspect of OSGi for many people. However, having to export implementation classes from a bundle obviously opens huge holes in the modularity story, suddenly you are exporting implementation classes to the world. This makes the coupling a lot less loose.&lt;br /&gt;&lt;br /&gt;My personal feeling is that application models are only trying to patch up these modularity holes with an emergency bandage. This is like drinking heavily and then taking aspirine against the headache. Maybe less drinking would be healthier?&lt;br /&gt;&lt;br /&gt;This said, there is of course a concept of &lt;i&gt;applicationness&lt;/i&gt;, otherwise not so many people would demand it. However, I do feel that the bundle is the right granularity for application granularity. A good bundle provides one or more functions and expresses dependencies on other bundles through services. That is all, no other primitives are needed (the services imply one or more Java packages). If I want to run an &lt;i&gt;application&lt;/i&gt; I pick a bundle that provides me with the right functionality. Systems like &lt;a href="http://www.osgi.org/Repository/HomePage"&gt;OBR&lt;/a&gt; can then be used to find bundles that provide the needed services.&lt;br /&gt;&lt;br /&gt;Dynamic dependency resolving is needed to create flexible systems. One of the key problems with an application model is that it fixes the application to a specific set of bundles; making it applicable to only one environment and thereby limiting severely the overall reusability.&lt;br /&gt;&lt;br /&gt;One of the key issues is of course testing. Many companies want to be able to send a set of bundles to QA and be sure that that is exactly the set that will be deployed on the target system. I do understand this issue. However, I think that the best solution to this requirement is to run these bundles in a framework, or even a VM, of their own. In certain cases, it is even wise to just wrap up all the bundles into one so you are sure they can not be separated. From a modularity perspective, if these bundles are so closely coupled together, why separate them?&lt;br /&gt;&lt;br /&gt;Fortunately, the EGs have come up with a model that seems to fit the needs to scope a set of bundles: nested frameworks. They are currently investigating a solution where you can create new frameworks inside an existing framework with relatively little cost. This solution seems to be very unintrusive to the spec because it adds a feature but does not (I hope) influence the existing features, at least not in a major way. Nested framework allow a managing framework to create nested frameworks for each "application". Services can be shared between frameworks by using the existing notification mechanisms and registering the service in alternative frameworks. Even packages could be shared with the &lt;br /&gt;&lt;br /&gt;To conclude. I think the demand for an application model is largely driven by problems that are caused by the Class.forName extension model and tight coupling that caused developers to share implementation classes. Even after ten years I think that the bundle-service model of OSGi is the cleanest solutions to software development that I know. I do hope that we will not dilute this model by patching OSGi to support the lesser implementation class sharing model. Then again, with nested frameworks we all can seem to get what we want!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.aQute.biz"&gt;Peter Kriens&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/07/osgi-application-grouping.html' title='OSGi Application Grouping'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=5742308873045641620&amp;isPopup=true' title='2 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/5742308873045641620'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/5742308873045641620'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-6775570255633795095</id><published>2008-07-02T06:04:00.005Z</published><updated>2008-07-06T20:06:54.449Z</updated><title type='text'>QVO VADIMVS?</title><content type='html'>We are seeing more and more outlines appearing for the next OSGi release. One of the major issues is legacy code. Not only inside the OSGi, but if you go to the web you see a lot of people struggling to get old code to work inside OSGi frameworks. Obviously, we want to mitigate the issues around legacy code as much as possible, the more people that use OSGi the better. However, lately I have some (personal, this absolutely is not an OSGi standpoint!) musings about how to attack the issue of legacy code.&lt;br /&gt;&lt;br /&gt;A short story to illustrate my musings. In the eighties, I worked on a page-makeup terminal for the newspaper industry. Petr van Blokland, a graphic designer turned computer specialist, introduced me to the layout grid. This grid had columns and between the columns there was a small gutter. Text and pictures were placed on this grid, usually encompassing multiple columns and gutters. Like:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;img src="https://www.osgi.org/wiki/uploads/Blog/grid.png" /&gt;&lt;/center&gt;&lt;br /&gt;The OSGi always reminds me of this grid. Why? Because they both restrict you severely but in return they provide simplicity. Instead of having infinite freedom to do whatever you feel like, you must obey some pretty basic rules, which some people find upsetting. But what you get back is that the elements work together as a whole, instead of fighting with each other.&lt;br /&gt;&lt;br /&gt;Layouts done with this grid almost invariably look good with no effort (try working with the average layout manager in Swing or SWT!). The advantage is that elements always line up and there is always the same space between elements. Without a grid, it is very hard to avoid unwanted visual effects.&lt;br /&gt;&lt;br /&gt;Genuine OSGi bundles almost invariably collaborate with each other without much effort (anybody saw the combination Eclipse and Spring coming?) because modules are self-contained and can only export packages and communicate via services instead of the myriad of ways people have devised in Java.&lt;br /&gt;&lt;br /&gt;Interestingly, both are achieved by &lt;i&gt;restricting ones freedom&lt;/i&gt;, the opposite of providing more features. But neither OSGi nor this grid is simplistic. A simplistic grid would be a square 8x8 grid, and they just do not work. A simplistic OSGi would be some Class.forName based system without handling versions and dependencies. Both OSGi and the grid seem to be in a sweet spot: simple but not simplistic, providing maximum bang for the buck.&lt;br /&gt;&lt;br /&gt;However, legacy code seems to be forcing us to add more and more mechanisms to the OSGi specification. Unfortunately, these mechanisms are often also then used for new OSGi applications because the legacy concepts they represent feel familiar to people. See how many people use Require-Bundle and fragments.&lt;br /&gt;&lt;br /&gt;If we add all these freedoms to the next generation, will we not pollute the original model and become in the end much less attractive? Or, if we do not make it easier to use legacy code, will people turn away because they feel affronted that their direct needs are not addressed? Should we leave these issues to framework implementations making legacy code not really portable?&lt;br /&gt;&lt;br /&gt;The current popularity of OSGi seems to allow the OSGi to make a stand. What do &lt;i&gt;you&lt;/i&gt; think?&lt;br /&gt;&lt;br /&gt;&lt;a style="margin-left: 20px;" href="http://www.aqute.biz/"&gt;Peter Kriens&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/07/qvo-vadimus.html' title='QVO VADIMVS?'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=6775570255633795095&amp;isPopup=true' title='8 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/6775570255633795095'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/6775570255633795095'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-401071185705982790</id><published>2008-06-17T14:43:00.005Z</published><updated>2008-06-18T08:12:04.240Z</updated><title type='text'>JSR 277 and Import-Package</title><content type='html'>&lt;img style="padding: 10px;" src="http://www.aqute.biz/uploads/About/peter120x120.gif" align="left" /&gt;It looks like Sun is not convinced that Import-Package is a good idea. On the &lt;a href="http://mail.openjdk.java.net/mailman/listinfo/jsr277-eg-observer"&gt;JSR 277 mailing list&lt;/a&gt; there was an interesting discussion about the dependency model: Does Import-Package have value over Require-Bundle (to use the OSGi terms)?&lt;br /&gt;&lt;br /&gt;Require-Bundle has an intuitive appeal that is hard to deny. These are the artifacts on the class path during compile time and there is a clear advantage to have these same artifacts during deployment. Import-Package is cumbersome to maintain by hand and basically requires tools like &lt;a href="http://www.aqute.biz/Code/Bnd"&gt;bnd&lt;/a&gt;. Besides, the whole world seems to use the Require-Bundle model (maven, ivy, netbeans, ...). So, who would ever want to use Import-Package?&lt;br /&gt;&lt;br /&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: right; cursor: pointer; width: 160px;" src="https://www.osgi.org/wiki/uploads/Main/chewing-gum-heel.jpg" alt="" border="0" /&gt;Well, have you ever had chewing gum in your hair?&lt;br /&gt;&lt;br /&gt;The harder you try to remove it, the more entangled it gets? This is what Require-Bundle gives you. Import-Package is more like &lt;a href="http://www.hasbro.com/playdoh/"&gt;Play-Doh&lt;/a&gt;. It is still better not to have it in your hair, but you can ask any kindergarten teacher what she prefers!&lt;br /&gt;&lt;br /&gt;So, now we have the right mental image, what is the technical reason for this stickiness? I see two reasons:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Require-Bundle gives you much more than you actually &lt;i&gt;use&lt;/i&gt; because your class files just do not refer to it, a key advantage of a static typed language. Now before you jump to the conclusion you do not care because it is free, realize that there is rent to pay for these &lt;i&gt;unused&lt;/i&gt; parts. These unused parts have their own dependencies that need to be satisfied; so they've has just become &lt;i&gt;your&lt;/i&gt; dependencies. Visualize the chewing gum in that strand of hair? Dependencies are annoying, and unnecessary dependencies are worse, but these kinds of tied dependencies can be a death knell if they turn out not to be compatible with yours when your code is combined with other bundles to create a system.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You depend on the whims of the bundle's author. He usually has no clue what parts of his bundle are used and is already busy working on the next version. He will make decisions based on his needs, not yours. It is therefore likely that the constituents in the bundle will change over time. How can you be sure that this migration happens in a way that is compatible with your bundles? Not only can the next version bring quite unnecessary and unexpected new dependencies, it might actually remove the actual packages you depend on. Unfortunately, your bundle resolves because the bundle you require is present, but its changes were just not compatible with your expectations so you get a Class Not Found Exception in the middle of shutting down this nuclear reactor.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;The underlying reason for this problem is lack of cohesion. Cohesion is the measure of how much the code in a JAR is related. For example, utility packages or bundles often have quite low cohesion. For example, the Apache Derby SQL database contains a very interesting file system abstraction that is highly usable without Derby. That is, the cohesion between the core SQL database code and this abstraction is very low. The core Derby uses it, but it is not pertinent to being a SQL database. This is common practice because we programmers really dislike to get lots of puny little artifacts.&lt;br /&gt;&lt;br /&gt;It is a fact of life that the cohesion in most JARs is quite low while the cohesion in packages is very high. As an example, the Apache Derby file abstraction is nicely packaged in a specification package and an implementation package. Why not extract it one day? Well, I am fine with this improvement and it would not affect any of my bundles at all. Import-Package does not care what bundle provides the package. If I had not warned them so often, I would feel sorry for all my colleagues that just had their bundles broken by a lone programmer somewhere in the world ...&lt;br /&gt;&lt;br /&gt;Two very practical use cases that illustrate these problems. Eclipse, who heavily relies on Require-Bundle, needed to support SWT (the graphics library) on the embedded platform and on the SE platform. The embedded platform needed to be a subset of the SE platform. Unfortunately, all users of SWT had been using Require-Bundle. This made the simple solution, refactoring the SWT bundle in two bundles, impossible because it would break each and every Eclipse plugin. Bundles that used Import-Package would have been oblivious of this change.&lt;br /&gt;&lt;br /&gt;The other use case is described in a recent blog: &lt;a href="http://ekkes-corner.blogspot.com/2008/06/catch-22-logging-with-osgi-frameworks.html"&gt;Catch-22 Logging with OSGI Frameworks &lt;/a&gt;. It is a rather long story but it boils down to that he could not combine two libraries due to unnecessary constraints caused by Require-Bundle with respect to logging. If you have the masochistic desire for the same sensation as having chewing gum in your hair, I recommend to read this blog.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.aqute.biz/"&gt;Peter Kriens&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/06/jsr-277-and-import-package.html' title='JSR 277 and Import-Package'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=401071185705982790&amp;isPopup=true' title='3 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/401071185705982790'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/401071185705982790'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-6427282513783266731</id><published>2008-06-05T13:19:00.002Z</published><updated>2008-06-05T13:45:58.758Z</updated><title type='text'>Community Event</title><content type='html'>You did not forget to register yet, did you?&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;img src="https://www.osgi.org/wiki/uploads/Main/berlin.jpg" /&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;See you next week in Berlin!&lt;br /&gt;&lt;br /&gt;  &lt;a href="http://www.aqute.biz/"&gt;Peter Kriens&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;P.S. As an extra bonus we will host an &lt;a href="http://www.se-radio.net/"&gt;SE Radio Interview&lt;/a&gt;! Shouldn't miss it if I were you!</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/06/community-event.html' title='Community Event'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=6427282513783266731&amp;isPopup=true' title='2 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/6427282513783266731'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/6427282513783266731'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-2000457852049846537</id><published>2008-05-30T07:41:00.007Z</published><updated>2008-05-30T10:22:17.914Z</updated><title type='text'>Is 9903520300447984150353281023 Too Small?</title><content type='html'>JSR 277's Stanley Ho &lt;a href="http://weblogs.java.net/blog/stanleyh/archive/2008/05/versioning_in_t_1.html"&gt;published a rationale&lt;/a&gt; why (in the so far unpublished EDR2) JAva Modules (JAM) invent a brand new version scheme. A rationale that needs a &lt;span style="font-style: italic;"&gt;lot&lt;/span&gt; of text. I could go in painstaking detail, but I think the rationale derails in one of the first paragraphs where the requirements are (implicitly) described. I highlighted the part that describes in what kind of situations you use the major, minor, micro, update, and qualifier version parts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;Major version number should be incremented for making changes&lt;/span&gt; &lt;span style="color: rgb(204, 204, 204);"&gt;that are&lt;/span&gt; not backward-compatible. &lt;span style="color: rgb(204, 204, 204);"&gt;The minor and the micro numbers should then be reset to zero and the update number omitted.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;Minor version number should be incremented for making medium or minor changes where the software remains &lt;/span&gt;largely backward-compatible (although minor incompatibilities might be possible)&lt;span style="color: rgb(192, 192, 192);"&gt;; the micro number should then be reset to zero and the update number omitted.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;Micro version number should be incremented for changing implementation details where the software remains &lt;/span&gt;largely backward compatible (although minor incompatibilities might be possible)&lt;span style="color: rgb(204, 204, 204);"&gt;; the update number should then be omitted.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;Update version number should be incremented for adding bug fixes or performance improvements in a &lt;/span&gt;highly compatible fashion.&lt;/li&gt;&lt;li style="color: rgb(204, 204, 204);"&gt;Qualifier should be changed when the &lt;span style="color: rgb(0, 0, 0);"&gt;build number or milestone&lt;/span&gt; is changed.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Can you spot the difference between &lt;span style="font-style: italic;"&gt;minor&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;micro&lt;/span&gt;? I can't, and that is the reason that OSGi  proposes the following convention: incompatible (major), backward compatible (minor), no API change/bugfix (micro), and builds or variations (qualifier). That is, our &lt;span style="font-style: italic;"&gt;micro&lt;/span&gt; is Sun's &lt;span style="font-style: italic;"&gt;update&lt;/span&gt; because Sun's &lt;span style="font-style: italic;"&gt;minor&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;micro&lt;/span&gt; appear to have an identical purpose.&lt;br /&gt;&lt;br /&gt;And ever thought about the concept of &lt;span style="font-style: italic;"&gt;largely backward compatible&lt;/span&gt;? Isn't that something like a &lt;span style="font-style: italic;"&gt;little bit pregnant&lt;/span&gt;?&lt;br /&gt;&lt;br /&gt;There are always reason to improve on existing schemes, but any improvement should be balanced against the interests of the existing and future audiences. I am not stating that the OSGi version is the mother of all version schemes, we are as fallible as all of us. Maybe we were too rationalistic; we looked at a lot of schemes and saw how people were also looking for more room at the low-end of the version scheme and hardly ever incremented the first numbers. If you standardize there is always a tension between allowing as much freedom as possible but also minimizing the complexity of the implementations that are depending on the variations you offer. We chose simplicity.&lt;br /&gt;&lt;br /&gt;Is the OSGi scheme usable? Well, we have no outstanding requirements or bugs in this area, nor were any proposed in JSR 291, while at the same time it is heavily used. Jason van Zyl, Maven, told me they were thinking of adopting the scheme as well. SpringSource converted almost 400 open source projects to bundles and they did not complain. Seems there is a lot of practical usage out there.&lt;br /&gt;&lt;br /&gt;Wouldn't it be a lot more productive  for &lt;span style="font-style: italic;"&gt;all&lt;/span&gt; of us if Sun would just adopt the OSGi scheme? There is lots of work to do on the module API, why not reuse existing specifications where you can? And if the OSGi scheme has burning issues, why not report that as a bug or change request, after all Sun is a distinguished OSGi member.&lt;br /&gt;&lt;br /&gt;With an infinite number of builds or variations, 9903520300447984150353281023 possible bug fixes (80.000 fixes per microsecond until the Sun implodes), 4611686014132420609 backward compatible changes, and 2147483647  incompatible releases, the OSGi spec seems to have enough room to breathe for mere mortals.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.aqute.biz/"&gt;Peter Kriens&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;P.S. You did register for the &lt;a href="http://www.osgi.org/CommunityEvent/HomePage"&gt;OSGi Community Event in Berlin, June 10-11&lt;/a&gt;? Please do so, we have a very strong program prepared with lots of cool demos. Hope to see you there!</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/05/is-9903520300447984150353281023-too.html' title='Is 9903520300447984150353281023 Too Small?'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=2000457852049846537&amp;isPopup=true' title='7 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/2000457852049846537'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/2000457852049846537'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-5223613086707268662</id><published>2008-05-27T15:07:00.003Z</published><updated>2008-05-27T17:20:04.346Z</updated><title type='text'>BUGs I Like!</title><content type='html'>Last week I blackmailed Ken Gilmer of &lt;a href="http://www.buglabs.net/"&gt;Buglabs&lt;/a&gt; into finally sending me an evaluation set. He had promised me this set for some time and I wanted him to show this kit on the &lt;a href="http://www.osgi.org/CommunityEvent/HomePage"&gt;OSGi Community Event on June 10-11&lt;/a&gt; (You did register I hope?). Ken could not come due to other obligations so I promised to make a demo if he would send me an evaluation kit.&lt;br /&gt;&lt;br /&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="https://www.osgi.org/wiki/uploads/Links/box.jpg" alt="" border="0" width="100" /&gt;So yesterday Fedex delivered a nice red box at my doorstep! It is always nice when a company spends a bit of effort on designing the box; this package reminded me of my first TomTom, a company that also took care in making the unwrapping experience fun.&lt;br /&gt;&lt;br /&gt;The content was a BUG with 4 modules. The BUG itself is the core computer that drives (hopefully) cheap modules. The core contains a small LCD, a minimal joystick, a push button and 4 LEDs that can also be pressed. It is powered through a separate (universal) power supply. Unfortunately, the also present small USB connector is not used to power the device; it is only there for the communications with the development computer. A slide-switch acts as on-off button.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;img src="https://www.osgi.org/wiki/uploads/Links/bug_front.jpg" style="margin: 0pt 10px 10px 0pt; cursor: pointer;" /&gt;&lt;/center&gt;&lt;br /&gt;There are 4 modules included:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;LCD Display&lt;/li&gt;&lt;li&gt;GPS&lt;/li&gt;&lt;li&gt;Motion Detector&lt;/li&gt;&lt;li&gt;Camera&lt;/li&gt;&lt;/ol&gt;The modules insert into one of the 4 slots of the BUG, there are no specific positions nor are you limited to a single type per BUG. That is, if you want 4 LCD displays, go ahead and do it. I think the modules should be hot swappable but that did not work for me. Hope that will work in the future.&lt;br /&gt;&lt;br /&gt;The development environment is based on (surprise!)  Eclipse, called &lt;span style="font-style: italic;"&gt;DragonFly&lt;/span&gt;. They told me to use Eclipse 3.3 (Europa) but I decided to live risky and use my current 3.4 Ganymede copy of Eclipse. At least this way I can only blame myself for some of the things that did not work. DragonFly replaces PDE but there are a number of similarities. Also, the manifest file is the driver for the generation. Overall it was very simple to write a new bundle when you are familiar with Eclipse. DragonFly nicely creates a complete project for you with the classpath setup correctly.&lt;br /&gt;&lt;br /&gt;For debugging there is a pretty good emulator that reuses the same Java code and implements the services that abstract the devices. You just ask a project to "Debug As" and the select the Virtual Bug. Very smooth. Once the Virtual BUG is running it appears as a device in the list of Bugs. You can drag and drop your project to these devices and that will install them. This drag and drop interface works very well for device management.&lt;br /&gt;&lt;br /&gt;The runtime is of course the most interesting part of this device. It runs the (now) open source &lt;a href="https://phoneme.dev.java.net/"&gt;PhoneME&lt;/a&gt; project. This is a CDC VM that supports most of the core Java SE libraries. On top of this VM, BUGLabs uses a &lt;a href="http://concierge.sourceforge.net/"&gt;Concierge&lt;/a&gt; framework. Concierge took the decision to not move to Release 4 but stick on Release 3 because of size reasons. This makes my feelings toward concierge slightly ambivalent. Release 4 added some very important changes that I hate to miss. I know that size matters, but the difference is not that dramatic with today's memory prices. Ok, I prefer OSGi over no OSGi, but staying behind on release level is very tricky. Lots of bundles now use the Bundle.getBundleContext() method, like Declarative Services, which is not part of R3. Also, the modularity layer got an important boost in R4. However, the biggest problem is compliance. Concierge was not tested for compliance and with the OSGi's current rules we cannot certify it anymore. During the development of R4 we seriously discussed the problem of the size the new features would take. Siemens, who had their own OSGi implementation for the vehicle market, even did a study to the impact. We very consciously decided that these new features were worth the added memory. I guess there is not much we can do about this, but it is a pity that we now have a split in OSGi, a split which we tried to avoid so hard. Anyway, better an OSGi R3 than no OSGi I guess ...&lt;br /&gt;&lt;br /&gt;I decided to build a little application to get a feel for the whole thing. I decided to build an automatic camera that would take a picture whenever the GPS indicated that you had moved more than 50 meters. The track thus created would then be available over a web interface. Formatted as a &lt;a href="http://code.google.com/apis/kml/documentation/kml_tut.html"&gt;KML file&lt;/a&gt;, it can be displayed in Google Earth. Simple.&lt;br /&gt;&lt;br /&gt;Well, writing the application was quite smooth and the debugger was great. Getting it to run on the device was a bit harder because it just did not take pictures. It took some time to figure out how to use the Concierge shell. Even that did not help, there was something with the GPS service. Anyway, I guess with some help this will work before the community event. See if I can get my trip to Berlin recorded!&lt;br /&gt;&lt;br /&gt;I wish I had had this device while I was working for Ericsson Research in 1998. It is absolutely perfect for trying out automation scenarios. I remember soldering an &lt;a href="http://www.velleman.be/ot/en/product/view/?id=9383"&gt;IO board&lt;/a&gt;, a movement sensor and a mobile phone to demonstrate a burglar alarm system based on sending a picture to the police. This scenario would have been a snap with the BUG.&lt;br /&gt;&lt;br /&gt;So what are the application areas for the BUG? If you are one of those lucky people that can now and then wander from the virtual world into reality, then this is abslutely your device. You get a quite powerful computer that can be extended with a snap, ehh, 4 snaps. Obviously, if you still can get excited of what you can do with computers (like me), then it is just too much fun to miss. And if you give OSGi tutorials, well, this kind of device makes OSGi shine.&lt;br /&gt;&lt;br /&gt;This is not to say they have arrived. BUG labs still has a lot of work carved out for them. The success will depend on amount of modules they can turn out in the coming years. I wish they had developed a &lt;a href="http://www.radioshack.com/product/index.jsp?productId=2734155"&gt;breadboard&lt;/a&gt; module first so other companies and individuals could make modules. In earlier times I played a lot with the PIC processors from Microchip and it would be quite easy to interface these into the system. Also, a &lt;a href="http://www.maxim-ic.com/products/1-wire/"&gt;1-Wire&lt;/a&gt; interface would be really fantastic.  1-wire devices are relatively cheap, and very easy to interface. For a few dollars you could extend a BUG with a temperature sensor, humidity sensor, unique ids, switches, cryptography tokens, etc. Remember the famous Java ring? Well, that was a 1-wire device.&lt;br /&gt;&lt;br /&gt;The development environment and the documentation also require some work. As a true open source project they use a Wiki for their documentation so do not hesitate to help to make the BUG more popular. There is also a need for more BUG modules as well: Wifi, audio in/out, power switches, video, bar code readers, proximity detectors, RFID readers, fingerprint readers, Zigbee I/O, Bluetooth, infra-red, geiger-tellers, etc., etc.. There is a mighty amount of work awaiting them.&lt;br /&gt;&lt;br /&gt;I really do hope other companies will pick up this concept and start to leverage it. Again, I wish I had had this device in 1998 when we were struggling to create demos!&lt;br /&gt;&lt;br /&gt;   &lt;a href="http://www.blogger.com/www.aQute.biz"&gt;Peter Kriens&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;P.S. But what on earth is the Teleporter module going to do???</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/05/bugs-i-like.html' title='BUGs I Like!'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=5223613086707268662&amp;isPopup=true' title='3 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/5223613086707268662'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/5223613086707268662'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-8279467563076856615</id><published>2008-05-13T09:32:00.011Z</published><updated>2008-05-16T07:04:39.821Z</updated><title type='text'>Java Modularity</title><content type='html'>&lt;img style="padding: 10px;" src="http://www.aqute.biz/uploads/About/peter120x120.gif" align="left" /&gt; Before JavaOne, there were clearly changes in the air with respect to JSR 277 Modules for Java and JSR 294 Superpackages. The announcement of &lt;a href="http://blogs.sun.com/dochez/entry/glassfish_v3_runs_on_osgi"&gt;Glassfish to support OSGi&lt;/a&gt; and the &lt;a href="https://fuji.dev.java.net/" net=""&gt;project Fuji&lt;/a&gt; (an ESB/JBI implementation based on OSGi) represent a significant mind-shift at Sun. We also saw Stanley Ho's interoperability paper on the JSR 277 mailing list. I therefore was happily surprised when the JSR 277 Java Modularity spec leads, Alex Buckley and Stanley Ho, when they asked me if I still wanted to join JSR 277.&lt;br /&gt;&lt;br /&gt;This question posed a dilemma for me. Was I still interested? Two years ago when JSR 277 started I was rejected and I made a big fuzz about this, which obviously puts a moral burden on me now. Also, the changes around JSR 294 Superpackages definitely inclined me to join. JSR 294 was now folded back in JSR 277 and its course had changed 180 degrees. Instead of an overly redundant poorly thought out model Alex had kicked the bucket under the superpackages draft and proposed the much simpler concept of an access modifier called &lt;i&gt;module&lt;/i&gt;. Though this idea had not been worked out in detail, it clearly was much, much, more feasible. Modules setup this way could be very usable in the OSGi world. My technical me would love to work on this aspect.&lt;br /&gt;&lt;br /&gt;However, JSR 277 now consists of two good (Repository and Language modules) and one bad part (JAM). Just before JavaOne 2008 Stanley had published a brief OSGi interoperability document. This document was not only very thin on details, it also referred in many places to an invisible Early Draft #2 (EDR2). I asked the EG members BJ Hargrave and Richard Hall if they had seen this EDR2, but it was unknown to them as well. I had recently complained about the lack of discussions on the JSR 277 mailing list, so it seems that work had been going on stealthily.&lt;br /&gt;&lt;br /&gt;During the JSR 277 presentations Alex and Stanley it became clear to me that a &lt;i&gt;lot&lt;/i&gt; of work had happened behind the scenes; Without any communications on the mailing lists.  For somebody in the audience it was absolutely not clear that almost everything that was said was never discussed in the EG. How could I participate in an EG if the only option would be to approve work done at Sun behind the curtains? How much change can there be if the unpublished EDR2 is presented at JavaOne as the stable result for JSR 277? Should I join an EG where most of the work was already done? How many fundamental changes can you achieve in this situation?&lt;br /&gt;&lt;br /&gt;I wish it was differently. Bryan Atsatt did a lot of work to convince Sun to open up, and it worked better than one could have expected. So, there is a lot of moral pressure on me to compromise and accept. As several people said: "Sun will not give up their JAMs, so get over it." Now, it is in my nature to compromise; I prefer working together on technical details instead of fighting. However, I just turned 50 years old and I can recall too many painful events where I compromised against my technical instinct. Years later the forces behind the compromise were forgotten and the inferior technical design remained with my name attached to it. I really do not like that and this seems one of those cases.&lt;br /&gt;&lt;br /&gt;So why do I not like JAMs? Well, who needs them? Do they provide something that OSGi not already provides? Alex and Stanley stressed the "fact" that JAMs are "deterministic" and "simple", the Siren's song of &lt;i&gt;simplistic&lt;/i&gt; solutions. Only when you do not fully understand the problem is JAM an attractive solution. The truth is, JAM creates &lt;span style="font-style: italic;"&gt;unnecessary&lt;/span&gt; complexity, the worst of all.&lt;br /&gt;&lt;br /&gt;There is only one argument that makes sense for a special module layer for the VM: The boot classes. Obviously during the boot phase a full-blown OSGi framework is not feasible because OSGi is written in Java. However, JAM will have exactly the same problems loading java.lang.Object because the environment to run the framework is not loaded yet. How do you process annotations without having the Class class loaded? Write an annotation layer in C? I will not even go into initialization and custom module binding support. Clearly, a special solution is required to modularize the core language packages. This problem was also faced by &lt;a href="http://developers.sun.com/learning/javaoneonline/2006/coreplatform/TS-3752.pdf"&gt;Apache Harmony&lt;/a&gt;. They also did not want to support a full blown OSGi framework in their VM, but they did understand the importance of existing standards. Apache Harmony modularized the bootpath classes and provides them as OSGi bundles using the standardized metadata. Because headers are in the manifest and easy to parse, no complex redundancy is required as with JAM's annotation support. Using the same metadata makes a seamless transition possible from booting all the way to running one of the many application servers defined on top of OSGi. For management systems it is ideal if they only have to worry about a single format.&lt;br /&gt;&lt;br /&gt;We are now at a crucial point in time. Though I'd love to participate in the discussions about modules in the Java language and the repositories, I cannot become responsible for a module system in Java that is creating this complexity for no rational reason. I do hope Sun will  take this last step as well, and drop JAM in favor of the much simpler approach of using the OSGi metadata throughout the system. In the last months we have gotten so far! Please?&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.aqute.biz/"&gt;Peter Kriens&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;P.S. Did you register at the &lt;a href="http://www.blogger.com/CommunityEvent/HomePage"&gt;Community Event&lt;/a&gt; yet? There are only 190 places and I think they will be filled up. After Sun's embrace of OSGi, a lot more people got interested. You surely do not want to miss it. Last week  we finalized the program it looks surprisingly strong.&lt;br /&gt;&lt;br /&gt;P.P.S. Do you regularly read this blog? Do you know you can become an OSGi supporter? This free of charge and it helps us make it more clear to people that you support OSGi, sometimes numbers help, becoming a supporter does help. Of course if you can afford it, we'd love even better to have you as a full member or adopter. Take a look at the &lt;a href="http://www.osgi.org/About/Join"&gt;conditions&lt;/a&gt;. Appreciated!</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/05/java-modularity.html' title='Java Modularity'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=8279467563076856615&amp;isPopup=true' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/8279467563076856615'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/8279467563076856615'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-8949898064945029488</id><published>2008-05-06T12:44:00.004Z</published><updated>2008-05-16T11:43:43.715Z</updated><title type='text'>SpringSource Application Platform + Bundle Repository</title><content type='html'>&lt;img src="http://www.aqute.biz/uploads/About/peter120x120.gif" align="left" /&gt; When &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;SpringSource&lt;/span&gt; announced their &lt;a href="http://www.springsource.com/web/guest/products/suite/applicationplatform"&gt;Application Platform&lt;/a&gt; and &lt;a href="http://www.springsource.com/repository/app/"&gt;Bundle Repository&lt;/a&gt; I was very excited. I had been informed something was coming and picked up rumors from the grapevine.The bundle repository was in one word: stunning. I had been looking into providing such a service but had decided that I could not afford it, despite the fact that I think that many companies would really benefit from such a service. This bundle repository must have been a terrible job to do. &lt;span style="font-style: italic;"&gt;Kudos!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Spring Source Application Platform was, however, a bit of a shock. Looking through the documentation I found lots of headers that &lt;i&gt;felt&lt;/i&gt; like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;OSGi&lt;/span&gt; but that I did not recognize: Import-Library, Import-Bundle, Application, etc. It looked like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;SpringSource&lt;/span&gt; had &lt;span style="font-style: italic;"&gt;“improved” &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;OSGi&lt;/span&gt; extensively. This was a bit of a shock, especially because they looked so much like standard &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;OSGi&lt;/span&gt; headers.&lt;br /&gt;&lt;br /&gt;I learned over the past 10 years that just adding a number of headers that solve a particular problem usually backfires. Something that sounds really good, does not have to be that good at all when you inspect it from a different perspective. The problem with standards is, is that it is very easy to add something but impossible to remove. You really have to get right as much as possible the first time; it is therefore better to err on the side of leaving things out. Due to the embedded origin of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;OSGi&lt;/span&gt; we have always been extremely careful to minimize the number of feature. Each additional feature require a lot of eyes and discussions and a very thorough analysis before it makes into the specification. Especially today, with a mature specification the feature interaction can be quite painful.&lt;br /&gt;&lt;br /&gt;Do not get me wrong, as a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_6"&gt;practitioner&lt;/span&gt; I do know the importance of  getting things to work and standards, by definition, are not always sufficient. I also know that a standardization process feels sometimes excruciatingly slow when you live in the trenches, and I love experiments.&lt;br /&gt;&lt;br /&gt;However, Eclipse has the same problem, but they have always been a good citizen in this respect. They always added proprietary headers in their own &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;name space&lt;/span&gt;, learned from their experiences, and then proposed a new standard. In all cases so far, the specification process was able to make the concept more general and fit better in the overall &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;OSGi&lt;/span&gt; model. Having a separate &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;name space&lt;/span&gt; was also a convenience for their customers. A specification process will undoubtedly change the semantics, requiring awkward constructs to distinguish between the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;SpringSource&lt;/span&gt; defined meanings and the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;OSGi&lt;/span&gt; defined meanings. I do realize that &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;OSGi&lt;/span&gt; does not own the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;name space&lt;/span&gt; in the manifest, and I do regret heavily that we did no better scope our header names, however, this did not seem overly important 10 years ago.&lt;br /&gt;&lt;br /&gt;Why would the standardized version be better? Because more eyes looked at it, from different perspectives (which sometimes can be quite bad for one's ego). One man's convenience is another man's complexity. This is why so far we have always focused on providing the primitives and not convenience functions because convenience is often in the eye of the beholder and can be provided during the development process in the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;IDE&lt;/span&gt; or run-time libraries.&lt;br /&gt;&lt;br /&gt;The biggest danger of a standard like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;OSGi&lt;/span&gt; today is &lt;i&gt;feature creep&lt;/i&gt;. The leanness of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;OSGi&lt;/span&gt; is one of its main attractions for many newcomers. It really took real hard work and untold man hours to make it this lean, believe me. Maybe the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;SpringSource&lt;/span&gt; headers are a significant improvement over the existing specification, maybe they turn out to be superfluous. Time will tell. I guess it is a sign of becoming more popular that companies try to stretch the specification in their world view. However, I do hope that most developers realize that restricting oneself to the standard may sometimes be a little bit less convenient, but it does provide one with a more options and no vendor lock-in down the line.&lt;br /&gt;&lt;br /&gt;So sadly, my feelings are mixed. I love what they have done with the bundle repository, and also many parts of the S2AP look very impressive, &lt;a href="http://neilbartlett.name/blog/2008/05/01/springsource-app-platform-is-a-curates-egg/"&gt;Neil Bartlett's blog&lt;/a&gt; provides an overview that I can very much sympathize with. I know several Spring &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;Sourcerers&lt;/span&gt; and they are very clever and capable people. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;SpringSource&lt;/span&gt; undeniably is meaning a lot for the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;OSGi&lt;/span&gt; organization and the adoption of the specifications. However, multiplying bundle headers feels more like coming from an apprentice than from the experts I know them to be.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.aqute.biz/"&gt;Peter &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;Kriens&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.osgi.org/wiki/uploads/Main/community-event-2008.png" align="left" /&gt;P.S. On a more positive note. We are reaching the first deadline for registration of the &lt;a href="http://www.osgi.org/CommunityEvent/HomePage"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;OSGi&lt;/span&gt; Community event in Berlin, June 10-11&lt;/a&gt;. I am part of the program committee and I can ensure you that it is worth coming. We actually had to split the second day into two tracks because we had so many good sessions submitted. Looking at the number of submissions it will look like we will sell out the places we have this year. This is the premier &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;OSGi&lt;/span&gt; event in Europe, we are really expecting all the key &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;OSGi&lt;/span&gt; people to be there. Take advantage of the early registration fee and &lt;a href="http://www.regonline.com/Checkin.asp?EventId=601153&amp;amp;RegTypeID=135734"&gt;register today&lt;/a&gt;!</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/05/springsource-application-platform.html' title='SpringSource Application Platform + Bundle Repository'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=8949898064945029488&amp;isPopup=true' title='7 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/8949898064945029488'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/8949898064945029488'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-6785096930816524160</id><published>2008-04-28T08:42:00.002Z</published><updated>2008-04-28T09:51:26.417Z</updated><title type='text'>KISS Principle</title><content type='html'>Wikipedia defines this principle as:&lt;br /&gt;&lt;br /&gt;&lt;div style="margin:10px;"&gt;The KISS principle (acronym for "Keep It Simple, Stupid") states that design simplicity should be a key goal and unnecessary complexity avoided. It serves as a useful principle in a wide array of disciplines, such as software development, animation, photography, engineering, and strategic planning.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Today Google Alerts dumped me into two discussions where OSGi seems to be on the wrong side of the divide regarding the KISS principle. The first is an extensive debate in the &lt;a href="http://www.nabble.com/Osgifing-Tomcat-to16830131.html"&gt;dev@tomcat.apache.org mailing list&lt;/a&gt;, the second is the &lt;a href="http://mail.openjdk.java.net/mailman/listinfo/jsr277-eg-observer"&gt;JSR 277 mailing list&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The Tomcat developers have been asked to &lt;i&gt;osgify&lt;/i&gt; their popular web server. This resulted in a discussion that was very interesting to read. Several people seem to have a disdain for the OSGi &lt;i&gt;zealots&lt;/i&gt;  (which I guess is me) but there seems to be a general uneasiness with this request. However, my key trigger for this blog was that in this discussion I noticed that several people regard OSGi as overly complex and heavy. The JSR 277 discussion raised the same problem from another direction. From the JSR 291 interoperation discussion: &lt;i&gt;"I wanted something in Java that was simpler and cleaner that OSGi-users could leverage if they wanted."&lt;/i&gt;. Is OSGi already ossified?&lt;br /&gt;&lt;br /&gt;The key problem to decide this question is, as so often the case, &lt;i&gt;requirements&lt;/i&gt;. Is Java complex? Hard to answer, if you want to write a  "Hello World" it is humongous overkill. If you are writing a large scale web application it is nice to have a solid foundation. The key phrase in the definition of KISS is &lt;i&gt;unnecessary complexity&lt;/i&gt;. Complexity is in the eye of the beholder.&lt;br /&gt;&lt;br /&gt;First, the OSGi API is very small by any measure. There is only one mandatory package that only has 26 class files, including the security and exception classes. And you can already leverage OSGi without writing Java code. Can you call it intrusive when you can turn a JAR into a bundle by adding one or two manifest lines? All the complexity people complain about is optional. That said, I do agree that even optional things create some kind of conceptual complexity. So maybe there is a lot of cruft in the options?&lt;br /&gt;&lt;br /&gt;Let us take a feature like import packages which is often considered hard. Most dependency mechanisms like Maven, Ivy, and also the original JSR 277 are based on the Require-Bundle concept. I.e. you declare a dependency on the &lt;i&gt;wrapper&lt;/i&gt;. &lt;br /&gt;Wrapper based dependency models are simple to understand for us humans. It would work actually very well in practice if JARs would be highly cohesive and not change their constituent packages over time. Which raises the question: Do you want the woman, or the dress?&lt;br /&gt;&lt;br /&gt;We developers have discovered the wonders of refactoring and things &lt;i&gt;do&lt;/i&gt; change. OSGi is a module system, it is about being able to change software while not breaking the deployments. Though import packages might be harder to understand initially than Require-Bundle, Import-Package does create more resilient systems because it minimizes coupling. That is why people that have used both systems usually decide to standardize on Import-Package (and bnd makes this quite easy). &lt;br /&gt;&lt;br /&gt;Similar to the &lt;code&gt;uses:&lt;/code&gt; directive. In the Tomcat discussion it was stated that the uses directives made the manifest unreadable. It was much nicer to create a manifest by hand, it looked better. I do agree from an aesthetic point of view but who reads a manifest? The manifest is intended to be read by the OSGi Framework. The uses directive is an incredible important concept to maintain classpace consistency when the same class can be loaded multiple times through different class loaders. If you have lived in a world where this model is supported, you understand that uses have a very high value because they minimize runtime problems. &lt;br /&gt;&lt;br /&gt;I do not say that OSGi has no unnecessary complexity at all. Obviously, the specification has been evolving over almost ten years. We have to tried to keep it is simple as possible, but we are as fallible as all of us. However, requirements have always come first in OSGi and fulfilling requirements just forbid you to make things too simple because they force you to understand the problem.&lt;br /&gt;&lt;br /&gt;Obviously the key question is, are many of these requirements highly specialized cases  not useful for the majority. Or are they just solving problems that awaits anybody that ventures into the wonderful land of modularity?&lt;br /&gt;&lt;br /&gt;  &lt;a href="http:/www.aQute.biz"&gt;Peter Kriens&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/04/kiss-principle.html' title='KISS Principle'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=6785096930816524160&amp;isPopup=true' title='4 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/6785096930816524160'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/6785096930816524160'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-4700958312246896930</id><published>2008-04-25T09:31:00.003Z</published><updated>2008-04-25T10:12:03.739Z</updated><title type='text'>First book on OSGi at JAX 2008!</title><content type='html'>Last evening I got back from a very pleasant trip to JAX 2008 in Wiesbaden. I was asked to give the best practice and the OSGi modularity presentations. Rod Johnson had already warmed the audience for OSGi with the result that we had to close the room when people where sitting, crawling, and standing everywhere even though there were still 40-50 people standing outside. Good news for OSGi, but I had to give the presentation for a second time that evening at 21.15, where I was surprised that there were still 50-60 people present that late in the evening. The next day was even better  because I got a much bigger room that was also filled. Feels good after gotten used to preaching to audiences of 10 people for so many years.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://luebken.com/wp-content/uploads/2008/03/2635.jpg"&gt;&lt;img style="margin:20px;" width="120px" src="http://luebken.com/wp-content/uploads/2008/03/2635.jpg" alt="" align="left" border="0" /&gt;&lt;/a&gt;I also got handed a copy of the first official OSGi book in the world. The book, written by Gerd Wütherich, Matthias Lübken, Nils Hartmann, and Bernd Kolb.&lt;br /&gt;&lt;br /&gt;This is a thorough book on OSGi (though Equinox biased) that I recommend to anyone who is using OSGi or wants to know more about it. You can buy it at &lt;a href="http://www.dpunkt.de/buecher/2635.html"&gt;d.punkt&lt;/a&gt;. I hope they translate it in English soon. I already read most of the text during my Christmas vacation to help them with a review. Gerd had already shown me on the first day the &lt;i&gt;thank you&lt;/i&gt; section. They had been really nice, and made the thank you in Dutch! Great work! It is great to finally being able to point to a good OSGi book.&lt;br /&gt;&lt;br /&gt;JAX is a great conference, very well organized. Well, there is so much to do that I'll keep it short. Though there is one observation, unrelated to OSGi, I can't help myself making. On the way back with Ryan Air I observed that people can be incredibly rude at jumping the queue, and not just the one that look like it, even elegantly looking older people showed an incredible rudeness. Though I admire Ryan Air for many things, their queue management is non existent, seeming to call out the worst behavior in people. I figured people behaved so badly so that to get the best seats in the plane. However, when I boarded at the end of the queue the emergency seats in the middle were still mostly free. So why are people so much in a hurry that they are jumping the queue? One day I have to debug this, but now back to the build!&lt;br /&gt;&lt;br /&gt;&lt;a style="margin-left:20px" href="http://www.aqute.biz"&gt;Peter Kriens&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;P.S. Talking about books, you can now also &lt;a href="http://www.aQute.biz/Sales/OSGi"&gt;order the specification&lt;/a&gt; (core + compendium) in printed form for a special price.</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/04/first-book-on-osgi-at-jax-2008.html' title='First book on OSGi at JAX 2008!'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=4700958312246896930&amp;isPopup=true' title='2 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/4700958312246896930'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/4700958312246896930'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-1384228145038559196</id><published>2008-04-19T14:52:00.008Z</published><updated>2008-04-20T15:40:23.624Z</updated><title type='text'>Is XML Part of the Problem?</title><content type='html'>&lt;img src="http://www.osgi.org/wiki/uploads/Main/xml.png" align="left"/&gt;Last week I had a great time in Stockholm working two days at &lt;a href="http://www.comactivity.net/"&gt;ComActivity AB&lt;/a&gt;. They are reworking their applications so they can take advantage of OSGi in their server applications. In this process they are investigating lots of technologies. And as is so often the case, one runs in modularity problems while using &lt;i&gt;legacy&lt;/i&gt; libraries. Ok, they are not all legacy libraries, they are often brand new and provide valuable functionality, and so often for free as well. What a world!&lt;br /&gt;&lt;br /&gt;However, integrating libraries into an OSGi based system is often fraud with class loader problems. In this case we took an in-depth look at the &lt;a href="http://www.spicefactory.org/cinnamon/"&gt;Cinnamon library&lt;/a&gt; from &lt;a href="http://www.spicefactory.org"&gt;www.spicefactory.org&lt;/a&gt;. This library is a Remote Procedure Call (RPC) library for Flex based applications using the &lt;a href="http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf"&gt;AMF&lt;/a&gt; protocol. AMF is an Adobe (publicized) standard for serializing ActionScript objects from Flash. &lt;br /&gt;&lt;br /&gt;At the start of the visit I was shown a very nice demo of the application. Fast, powerful, and looking good despite the austere theme they were using. As can be expected, the application took advantage of the OSGi architecture. A top level application used the service registry to discover &lt;i&gt;modules&lt;/i&gt; that implemented a specific application functionality. This module provided the Flex flash SWF file and provided the receiving end of the RPC interface. It was kind of cool to see how they made new bundles with &lt;a href="http://www.aqute.biz/Code/Bnd"&gt;bnd&lt;/a&gt;, deployed them with &lt;a href="http://felix.apache.org/site/apache-felix-file-install.html"&gt;File Install&lt;/a&gt; and during the whole morning never restarted their Tomcat that was hosting their OSGi WAR file.&lt;br /&gt;&lt;br /&gt;During the demo we went through the design by looking at the source code, modifying things, and then testing it. One thing I noticed was the large amount of configuration and specialized classes to make this application work with Cinnamon. I once write a tiny &lt;a href="http://www.osgi.org/blog/2006/09/osgi-uis-and-web.html"&gt;webrpc&lt;/a&gt; application and did not think it had to be that hard. (I am an optimist).&lt;br /&gt;&lt;br /&gt;One of the key issues was configuration. The Cinnamon library had two types of configuration: Spring based and a private XML configuration format. The key problem is that these text based configuration files are forced to use dynamic class loading. If these classes must come from other bundles, then OSGi (rightfully) barks. The whole purpose of the OSGi modularity is to have &lt;i&gt;controlled&lt;/i&gt; class loading, taking care of versions and other constraints. Doing Class.forName blissfully ignores such mundane details. A large part of the custom code was necessary to find the right classes at the right time.&lt;br /&gt;&lt;br /&gt;Obviously, this was working. However, &lt;i&gt;cruft&lt;/i&gt; frustrates me and I convinced them we should try to get rid of it. So at the last two hours of the second day we created a new project and started from scratch. No Spring XML and no Cinnamon XML. It was already at the end of the second day so we had little time but it turned out to be surprisingly simple to use the Cinnamon library from Java only, taking advantage of the facilities of the service registry (and that without even reading the manual or javadoc). Still, by getting rid of the XML configuration things became significantly easier. All of the class loading problems disappeared as by magic because from the Java code we had direct access to the right types without requiring dynamic loading.&lt;br /&gt;&lt;br /&gt;By single-stepping through the Cinnamon library I also noticed how much code was spent on making the library flexible and adaptable. As so many libraries today, it was doing impressive class loader gymnastics to implement yet another plugin system. I think the library could be significantly simplified if it had been using OSGi to provide this plugin mechanism with bundles and services. It is sad to see how many time the same wheels are invented over and over again.&lt;br /&gt;&lt;br /&gt;Anyway, I also remembered how I had a similar experience with Hibernate last year. In an effort to &lt;a href="http://www.osgi.org/blog/2007/06/osgi-and-hibernate.html"&gt;use Hibernate from an OSGi based system&lt;/a&gt;, I switched from the XML configuration to do the configuration in Java code. Also in that case, a lot of things that caused class loading issues just disappeared because classes could be manipulated as classes (with the proper versioning) and not as strings.  &lt;br /&gt;&lt;br /&gt;Different, but still related, the day before we had another experience where we significantly simplified life. They had used Spring to define global configuration for database connections. This is obviously highly specific information for each of their customers. With Spring they could provide this configuration through a bundle. However, if they wanted to change the configuration, they had to update this bundle. Looking closer at the configuration file it was clear that they were specifying several connections to databases. This looked like a clear case for the Configuration Admin's Managed Service Factory. We modified their pool manager to use the Configuration Admin by registering a Managed Service Factory service. This was only a few lines of code. They were already using &lt;a href="http://felix.apache.org/site/apache-felix-file-install.html"&gt;File Install&lt;/a&gt;, and File Install makes it easy to set new configurations by placing a property file in the watched directory. It was kind of sad to see how small and readable the property file was in comparison with the XML configuration it replaced.&lt;br /&gt;&lt;br /&gt;Now do not get me wrong. I am very impressed with the Spring, Cinnamon, and Hibernate libraries and I do see the value of centralizing configuration files. Maybe OSGi changes the rules a bit and this XML based model works better in monolithic applications. Lets face it, what is the difference of changing XML or Java code in Eclipse? However, last weeks experience makes me wonder if we should not be a little bit more critical before using XML to solve problems that are much cleaner and better solved in plain old Java? &lt;br /&gt;&lt;br /&gt;&lt;a style="margin-left:20px" href="http://www.aQute.biz"&gt;Peter Kriens&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/04/is-xml-part-of-problem.html' title='Is XML Part of the Problem?'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=1384228145038559196&amp;isPopup=true' title='3 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/1384228145038559196'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/1384228145038559196'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-6730264173978069182</id><published>2008-04-08T06:22:00.003Z</published><updated>2008-04-08T08:48:43.807Z</updated><title type='text'>JSR 294 Superpackages No More</title><content type='html'>&lt;img src="http://www.osgi.org/wiki/uploads/Main/superman.png" align="left" /&gt;Alex Buckley posted a mail to the &lt;a href="http://altair.cs.oswego.edu/pipermail/jsr294-modularity-eg/2008-March/000171.html"&gt;JSR 294 list&lt;/a&gt; with was more or less superpackages meeting &lt;a href="http://en.wikipedia.org/wiki/Kryptonite"&gt;kryptonite&lt;/a&gt;. Though in this case, Alex is in my opinion the good guy! He basically abandons all the unnecessary complexity of the earlier proposal, &lt;a href="http://www.osgi.org/blog/2007/11/jsr-294-superpackages.html"&gt;see my blog about this subject&lt;/a&gt;, and comes up with a guiding principle: ''simpler is better''.&lt;br /&gt;&lt;br /&gt;The proposal definitely follows that principle. A source file is marked with the word ''module'', just like a package. And that is basically it.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package org.osgi.framework;&lt;br /&gt;module org.osgi.core;&lt;br /&gt;&lt;br /&gt;public class AdminPermission {&lt;br /&gt;module void checkCertificate();&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The compiler encodes the module membership in the class file and the VM can enforce that any member attached with the module keyword is not accessible from another member unless it is in the same module. I like it! This can actually be quite useful, also for some of the work we are currently doing in the OSGi Alliance concerning modularization. More detail is needed, but this significant simplification is absolutely in the right direction. There are some rough edges obviously, and I like to weigh my input on them.&lt;br /&gt;&lt;br /&gt;Module membership should not be on the source but on the package because it is ''inherently'' safer. Alex argues in his &lt;a href="http://blogs.sun.com/abuckley/"&gt;blog&lt;/a&gt; that from a technical point of view the best place for module membership declaration is the package (package-info.java), but that from a ''moral'' point of view the class file is better because it allows one to introspect a class file and have all information together.  &lt;span style="font-style: italic;"&gt;Moral&lt;/span&gt; in this case should be seen as the Java philosophy, which he defines as focus on understandability by not letting the compiler infer information, but requiring that the programmer states his intentions clearly, even if this is redundant. I.e.&lt;br /&gt;&lt;pre&gt;  &lt;br /&gt;  List&amp;lt;List&amp;lt;List&amp;lt;CharSequece&amp;gt;&amp;gt;&amp;gt; list = new ArrayList&amp;lt;List&amp;lt;List&amp;lt;CharSequence&amp;gt;&amp;gt;&amp;gt;()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Is for me harder to read than:&lt;br /&gt;&lt;pre&gt;  &lt;br /&gt;  List&amp;lt;List&amp;lt;List&amp;lt;CharSequece&amp;gt;&amp;gt;&amp;gt; list = new ArrayList&amp;lt&amp;gt;()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Because I can trust the compiler to do the right thing and I trust it more with these things than my reading capabilities.&lt;br /&gt;&lt;br /&gt;I guess this was also attempted in the JLS, which is also highly redundant. Personally I think this decreases readability because you tend to glaze over sections you already have read 5 times in the previous page. However, this makes it too easy to miss small, highly important differences.&lt;br /&gt;&lt;br /&gt;Anyway, I guess consistency is important (though I strongly believe Java would be more readable with ''less'' verbosity, less is more!) but I still very much prefer inherent safe models instead of tool enforced safe models. Why would you introduce a data structure that can be wrong if you can also do it in a way that does not allow those errors? Let me explain this a bit more.&lt;br /&gt;&lt;br /&gt;Both Alex and I seem to agree wholeheartedly that packages are first class citizens and that you can not have modules criss-cross through packages. I.e. each package member &lt;span style="font-style: italic;"&gt;must&lt;/span&gt; have the same module membership. That is, you can not have two classes in the same package that would not belong to the same module. So module membership is therefore not on the type but on its package. Placing the module membership in the source of the type just allows you to create invalid configurations when two sources in the same package would have a different module membership, which will just require more tools to fix them.&lt;br /&gt;&lt;br /&gt;Putting the membership on the package would also be a good reason to overhaul the  reflection methods of Package. Packages have always been second class citizens in the Java VM, for example you can not find its members. By placing the module membership on the package we have a perfectly good reason to fix these deficiencies.&lt;br /&gt;&lt;br /&gt;Additionally, I do have some more wishes for the EDR2. I'll go through them shortly.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Module private interfaces - Modules should have module private interfaces. Currently, when you implement an interface, you are forced to make your method public. It must be possible to implement interfaces without forcing you to declare the  implementation methods public.&lt;/li&gt;&lt;li&gt;Class Loaders - Modules should be able to cross class loaders (with the restriction that packages do not cross class loaders). This will multiple bundles to form one module.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Dynamic Membership - I do hope the API will allow dynamic module membership. That is, it should be possible to add and remove packages to/from a module in runtime.&lt;/li&gt;&lt;li&gt;Module-Export - I think there  is a need to export a member or type to another module only. I.e. if module M1 imports M2, it should be possible for M2 to selectively exports members and types to an importer. This could be done with a keyword or an export on the module.  for example:&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;        M1: Import-Module: M2&lt;br /&gt;      public class Foo {&lt;br /&gt;        void bar() {&lt;br /&gt;          Ok ok = new Ok();           // no problem&lt;br /&gt;          new Fail(); }       // not visible&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      M2:&lt;br /&gt;      export module class Ok { }&lt;br /&gt;      module class Fail { }&lt;br /&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Scoping - Currently type references are only encoded with their name. It will be necessary to add the module name to a type reference, and while we are at it, it would be terrific if this then also encoded the version it was compiled against. This will allow the module system to calculate dependencies instead of relying on the old model of the serendiptity of the classpath. Obviously the module file should be able to change the hard references from versions (1.3.2) to a range (1.3,1.4).&lt;/li&gt;&lt;li&gt;Versions First class citizens - As show in the previous example, versions should become first class citizens. I do not think annotations are the right way to go for this.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;The previous points are requirements, and not solutions. I do not envy Alex's task to come up with JLS changes. This is the same as open heart surgery.&lt;br /&gt;&lt;br /&gt;From an OSGi perspective I think modules as proposed by Alex will be a welcome addition to&lt;br /&gt;the language. I think it addresses some of our uses cases we are working on. Nice work!&lt;br /&gt;&lt;br /&gt; Peter Kriens</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/04/jsr-294-superpackages-no-more.html' title='JSR 294 Superpackages No More'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=6730264173978069182&amp;isPopup=true' title='3 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/6730264173978069182'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/6730264173978069182'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-4631708667888291007</id><published>2008-03-27T08:53:00.006Z</published><updated>2008-04-01T08:41:10.433Z</updated><title type='text'>Ghost Town JCP</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.flickr.com/photos/confusedvision/" alt="Picture by confusedvision on flickr.com"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px;" src="http://farm2.static.flickr.com/1025/1329430615_9cf7311981_o.jpg" alt="" border="0"&gt;&lt;/a&gt;Is JSR 277 a ghost JSR or did the work move elsewhere? The last message on the JSR 277 mailing list was more than a month ago and before that traffic was virtually absent. Since June there is about a message per month on average, of which several are house keeping messages. Even &lt;a href="http://weblogs.java.net/blog/stanleyh/"&gt;Stanley Ho's blog&lt;/a&gt; has not seen a new entry since June. Did the discussions move to the Open JDK process? Looking at the &lt;a href="http://mail.openjdk.java.net/pipermail/modules-discuss/"&gt;modules-discuss archives&lt;/a&gt;, this does not seem to be the case. There is very little activity and the mails that I can read are about builds, and requests for information. The &lt;a href="http://mail.openjdk.java.net/pipermail/modules-dev/"&gt;modules-dev list&lt;/a&gt; contains nightly build reports, the last one is from Sunday March 2.  It therefore seems that work is going on, however, it seems hard to believe that there are no issues to discuss in this phase of the project. I assume that the people working in OpenJDK have another (closed?) mailing list where they discuss issues.&lt;br /&gt;&lt;br /&gt;The problem with free organizations (as in free beer) the cost are carried by one party that in exchange demands special rights. For example, the OpenJDK projects is mostly paid for by Sun, just like the JCP. However, the consequence is that if you submit a source code, you must grant Sun a perpetual and full license, with the rights to sub license, for all your code.Though the OpenJDK is available under the GPL license, this choice of license is a Sun decision. You can not submit your code as GPL to the OpenJDK project, the GPL is a license granted by Sun to its users. You therefore have to sign the &lt;a href="http://www.sun.com/software/opensource/contributor_agreement.jsp"&gt;Sun Contribution Agreement&lt;/a&gt;. In this contract you oblige yourself to&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;Share your copyrights with Sun &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;License any patents bearing on your contributions to Sun &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;They key is now that Sun provides the  OpenJDK to anyone under GPL  and parts of it with the Classpath exception that allows you to run code on it. However, for many companies this is too restrictive because they have special patents they are not willing to share or can not share their source code for other reasons. Obviously, Sun is willing to provide the OpenJDK under an an alternate license for an appropriate fee, or not. It is their call.&lt;br /&gt;&lt;br /&gt;If you do serious work in the JCP or OpenJDK, it is highly likely that the value of your donation to Sun significantly exceeds any membership fees of any open organizations.&lt;br /&gt;&lt;br /&gt;When I started using Java in 1996 I had a lot of confidence in Sun because I always thought that the way they handled the standardization of NFS in an exemplary way. I still do believe that most people working for Sun have the best intentions. However, for the good of the community the shepherd should not be one of the sheep.&lt;br /&gt;&lt;br /&gt;Zucht (Sigh in Dutch). Another blog side tracked about non-technical issues. I wish we could focus on the technical issues so we can show why and how the OSGi service platform is more ambitious and provides more and superior solutions for the modularity problem than JSR 277+294. It feels so sad that instead on working together on a suitable standard, Sun, against a lot of industry pressure, bifurcates the market for no technical reason. I do not claim the OSGi specs are perfect, there is work to do. However, they are mature, proven, have a large audience, and seem to provide more functionality than JSR 277 attempts to implement now (with a large learning curve ahead of them). Would such a situation have arisen when the Java community was shepherded in an more independent way?&lt;br /&gt;&lt;br /&gt; &lt;a href="http://www.aqute.biz/"&gt;Peter Kriens&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;P.S. I just learned that &lt;a href="http://neilbartlett.name/blog/"&gt;Neil Bartlett&lt;/a&gt; had the same idea and also posted a blog about the same subject ...</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/03/ghost-town-jcp.html' title='Ghost Town JCP'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=4631708667888291007&amp;isPopup=true' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/4631708667888291007'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/4631708667888291007'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-2050492372136411995</id><published>2008-03-19T22:50:00.006Z</published><updated>2008-03-19T23:37:09.302Z</updated><title type='text'>OSGi DevCon, Here We Still Are!</title><content type='html'>&lt;img src="http://farm4.static.flickr.com/3224/2345720231_7fee277884.jpg?v=0" align="right" /&gt;Sorry for not updating yesterday, but it is kind of hectic here. It seems almost impossible to walk more than 100ft without being asked a question about OSGi. But hey! That is a lot better than desperately getting people's attention. But it makes it kind of hard to update a blog.&lt;br /&gt;&lt;br /&gt;Anyway, yesterday we had a full program with lots of OSGi talks. Though I must admit the keynote was very entertaining, even without OSGi. The keynote was given by &lt;a href="http://fakesteve.blogspot.com/"&gt;Dan Lyons (Fake Steve Jobs)&lt;/a&gt;. Well, I let the pictures do the talking again.&lt;br /&gt;&lt;br /&gt;BJ Hargrave (IBM) and Neil Bartlett in their Android for OSGi presentation&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm4.static.flickr.com/3163/2346549414_be5dcfc48d.jpg?v=0"/&gt; &lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Christer Larsson and Eric Wistrand from Makewave working hard to get it to work.&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm4.static.flickr.com/3233/2346549322_9a3eff1f6e.jpg?v=0"/&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Marcel Offermans and Karl Pauls from Luminis making sure BJ and Neil got it right.&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2256/2346549522_ed77ce5ed1.jpg?v=0"/&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Yesterday evening we had an OSGi BOF, with drinks. There were quite a lot of people and everybody seems to have a good time.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;img src="http://farm3.static.flickr.com/2175/2345720381_393a3ed761.jpg?v=0" /&gt; &lt;img src="http://farm3.static.flickr.com/2275/2346549616_66f021997f.jpg?v=0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://farm4.static.flickr.com/3110/2345720435_2b762039da.jpg?v=0" /&gt; &lt;img src="http://farm3.static.flickr.com/2044/2346549684_7053c692d9.jpg?v=0" /&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Well, today we had the Bug Labs presentation (cool hardware!) and the Virtual OSGi presentation from Jan Rellermeyer (which has recently become our second Invited Researcher next to Richard Hall). &lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;img src="http://farm4.static.flickr.com/3122/2345720601_2c525d1c8a.jpg?v=0"/&gt; &lt;img src="http://farm4.static.flickr.com/3128/2346549850_90f7b18aef.jpg?v=0"/&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Sprint, ProSyst, and IBM presented the Sprint Titan program, which uses the OSGi framework in the incarnation of JSR 232, as a cornerstone. These phones support an amazing amount of standards. The Titan platform will become a very interesting platform, the first that will allow you to write code that runs in binary form on a phone, desktop, server, and mainframe.&lt;br /&gt;&lt;center&gt; &lt;br /&gt;&lt;img src="http://farm3.static.flickr.com/2215/2345720789_e422e382b1.jpg?v=0"/&gt; &lt;img src="http://farm3.static.flickr.com/2120/2346550002_f5f10485ba.jpg?v=0"/&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;I did not get a chance to to visit all session, unfortunately. There is so much going on at the same time. One thing that was very nice today, btw, was that I had a meeting with some of the Jason van Zijl, Eugene Kuleshov, Carlos Sanchez, and Jeff McAffer and we discussed aligning the mapping of the Bundle Symbolic Name and version issues. Watch this space.&lt;br /&gt;&lt;br /&gt;Tomorrow we will have the services versus extensions panel. This morning we met and it looks like it will be an interesting panel. Lots of people are interested in this subject.&lt;br /&gt;&lt;br /&gt;Wish you were here! &lt;br /&gt;&lt;br /&gt;   &lt;a href="http://www.aQute.biz"&gt;Peter Kriens&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/03/osgi-devcon-here-we-still-are.html' title='OSGi DevCon, Here We Still Are!'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=2050492372136411995&amp;isPopup=true' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/2050492372136411995'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/2050492372136411995'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-1308470033881687634</id><published>2008-03-18T13:53:00.002Z</published><updated>2008-03-18T14:33:57.423Z</updated><title type='text'>OSGi DevCon, Here We Are</title><content type='html'>We are getting ready for the second day of the conference. Yesterday, was (free!) tutorial day and the program was packed. I ran between tutorials to take pictures and see how things are going. The OSGi tutorials were very well attended and in several rooms there were not enough places. Anyway, let the pictures do the talking.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://farm4.static.flickr.com/3249/2342490919_697b42f2dc.jpg?v=0"/&gt;&lt;img src="http://farm4.static.flickr.com/3159/2342491701_c24aa0c07f.jpg?v=0"&gt; &lt;br /&gt;&lt;img src="http://farm4.static.flickr.com/3024/2343321284_687ac18c96.jpg?v=0"&gt; &lt;img src="http://farm3.static.flickr.com/2031/2343320998_2cceac298a.jpg?v=0"&gt;&lt;br /&gt;&lt;br /&gt;All pictures can be found at: &lt;a href="http://www.flickr.com/photos/49627806@N00/sets/72157604151597371/"&gt;Flickr&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So the real conference starts today with the keynote of &lt;a href="http://www.eclipsecon.org/2008/index.php?page=sub/&amp;id=537"&gt;Fake Steve Jobs&lt;/a&gt;. Then the short talks, Android, Services &amp; DI &amp; Extension points, Android, Building large applications and the BOF. And so much more where OSGi is involved. Last year, OSGi was a buzz, this year it feels like a roar!&lt;br /&gt;&lt;br /&gt;So if you are at OSGi DevCon/EclipseCon do not forget to come to the BOF at 7.30 pm. It would be great to meet you all. Ok, off to breakfast and a great day ...&lt;br /&gt;&lt;br /&gt;   &lt;a href="http://www.aQute.biz"&gt;Peter Kriens&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/03/osgi-devcon-here-we-are.html' title='OSGi DevCon, Here We Are'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=1308470033881687634&amp;isPopup=true' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/1308470033881687634'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/1308470033881687634'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-4648388844678345457</id><published>2008-03-17T13:21:00.006Z</published><updated>2008-03-17T21:12:50.438Z</updated><title type='text'>OSGi DevCon, Here We Come!</title><content type='html'>&lt;img src="http://www.aqute.biz/uploads/About/peter120x120.gif" align="left" /&gt;&lt;img src="http://www.osgi.org/wiki/uploads/Conference/osgi-devcon-small.gif" align="right" /&gt; Today, March 17, we are starting the OSGi DevCon. This year has a tremendous amount of events devoted to OSGi. The program has a special icon for OSGi events (thank you!) and it is littered over the schedule.&lt;br /&gt;&lt;br /&gt;Today is tutorial day and for the first time the tutorials are free. Select your tutorials carefully, though it is likely many will be full. I wanted to give you an overview but the OSGi talks are marked so well on the program that I just give you the link to the &lt;a href="http://www.eclipsecon.org/2008/index.php?page=table/&amp;amp;date=2008-03-17"&gt;Monday tutorials overview&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The first sessions have started and we have some photos fresh from the event.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;img src="https://www.osgi.org/wiki/uploads/Conference/26.jpg"/&gt;&lt;br /&gt;&lt;img src="https://www.osgi.org/wiki/uploads/Conference/36.jpg"/&gt;&lt;br /&gt;&lt;img src="https://www.osgi.org/wiki/uploads/Conference/41.jpg"/&gt;&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt; &lt;a href="http://www.aQute.biz"&gt;Peter Kriens&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/03/osgi-devcon-here-we-come.html' title='OSGi DevCon, Here We Come!'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=4648388844678345457&amp;isPopup=true' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/4648388844678345457'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/4648388844678345457'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-7555282766716330340</id><published>2008-02-27T14:05:00.004Z</published><updated>2008-02-27T14:22:29.869Z</updated><title type='text'>OSGi DevCon/EclipseCon</title><content type='html'>&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 120px;" src="http://www.osgi.org/wiki/uploads/Conference/osgi-devcon-small.gif" alt="" border="0" /&gt;I hope you did &lt;a href="http://www.eclipsecon.org/2008/"&gt;register&lt;/a&gt; at OSGi DevCon/EclipseCon? It is only three weeks to this event and we would really like to see you there. I think this years program is exceptionally strong. For sure the  OSGi DevCon program. It was really hard to choose this year from the large number of excellent proposals.&lt;br /&gt;&lt;br /&gt;Do you know that this year the registration includes tutorials? This is the first time I see this in a conference and I think it is an excellent idea. It allows you to choose without having to worry about the financial consequences. The only problem is that there are so many interesting subjects that it is hard to choose.&lt;br /&gt;&lt;br /&gt;The supposed dichotomy between services and extensions keeps people occupied. I hope we can finally decide this year when and where to use what. Not only do we have a tutorial, a presentation, but also a panel about this subject. To muddy the waters even further, a Jazz member will speak about a proposal that is supposed to merge the concepts. Whatever comes out of it, I am pretty sure it will be interesting.&lt;br /&gt;&lt;br /&gt;On Tuesday we have a BOF at 19:30. The OSGi Alliance board has a meeting in the valley and many of them will be present to talk to you. This will be an excellent moment to tell them your ideas, issues, and maybe kudos. Oh yeah, and there will be drinks!&lt;br /&gt;&lt;br /&gt;After the OSGi BOF, there will be a Distributed OSGi BOF that I really want to attend. Easy, it will be in the same room. My famous friend Jeff McAffer will have an Equinox/OSGi BOF on Wednesday so you will be able to find me there as well.&lt;br /&gt;&lt;br /&gt;There is an &lt;a href="http://www.osgi.org/Conference/HomePage"&gt;overview page&lt;/a&gt; with the whole OSGi DevCon program.&lt;br /&gt;&lt;br /&gt;I am really looking forward to see you this year at OSGi DevCon/EclipseCon. If there is only one conference you can go to this year, I urge you to pick this one. Don't wait too long with registering. There is a maximum and it is very likely they will reach this maximum this year.&lt;br /&gt;&lt;br /&gt;See you all in Santa Clara!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.aqute.biz/"&gt;Peter Kriens&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.osgi.org/blog/2008/02/osgi-devconeclipsecon.html' title='OSGi DevCon/EclipseCon'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18772002&amp;postID=7555282766716330340&amp;isPopup=true' title='2 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.osgi.org/blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/7555282766716330340'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18772002/posts/default/7555282766716330340'/><author><name>Peter Kriens</name><uri>http://www.blogger.com/profile/11373850803487010328</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-18772002.post-3368447532717199223</id><published>2008-02-21T14:43:00.005Z</published><updated>2008-02-21T17:23:35.745Z</updated><title type='text'>Research Challenges for OSGi</title><content type='html'>On my flight back from Berlin this week I listened to a podcast from &lt;a href="http://www.se-radio.net/"&gt;Software Engineering Radio&lt;/a&gt;. They interviewed Dave Thomas (OTI Dave Thomas) and it was a very interesting interview. One of the triggering parts was that Dave mentioned that PhD students often have a hard time finding good research challenges. That made me start thinking what the OSGi research challenges would be. Well, these are the ones I came up with.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The Stale Service Problem&lt;/h2&gt;&lt;br /&gt;The OSGi Framework provides isolation between bundles using a &lt;span style="font-style: italic;"&gt;class loader&lt;/span&gt; model. This model is quite effective, especially when security is also turned on. However, it is clearly not perfect because we have something called the &lt;i&gt;stale service&lt;/i&gt; problem. Bundles in an OSGi platform exchange objects. These objects are linked through their class to a class loader which is closely connected to a specific bundle. What happens when this bundle is started and stopped? Well, the specification tells the other  bundles to remove their references to any objects by sending out service notifications. These stale references will exist and hang around because they cannot be garbage collected. Those services refer to the class loader so a single stale reference can pin all the loaded classes of a bundle into memory for as long as it lives.&lt;br /&gt;&lt;br /&gt;But the refering bundle can remove any references and everything is ok! So what is the problem? Well, if you really came up with that question I suggest you do some code inspections of open source or in-house software. It is sometimes quite amazing what actually ends up being used. Let's face it, this cleaning up is hard and very error prone.&lt;br /&gt;&lt;br /&gt;From a specification point of view we have tried to minimize this problem. The &lt;a href="http://www.aqute.biz/Snippets/Tracker"&gt;service tracker&lt;/a&gt; is a direct result of this effort. After Richard S. Hall and Humberto Cervantes pioneered the &lt;a href="http://www.blogger.com/post-edit.g?blogID=18772002&amp;amp;postID=3368447532717199223"&gt;Service Binder&lt;/a&gt; we added the derived &lt;a href="http://www.aqute.biz/Snippets/HelloWorldComponent"&gt;Declarative Services&lt;/a&gt; to minimize the complexity of handling this stale service problem. However, from a specification point of view there is no way the problem can be handled full (or fool) proof.&lt;br /&gt;&lt;br /&gt;The simple solution is to place bundles in different memory spaces. This can be done with one VM per bundle or a more efficient method is to use isolates from &lt;a href="http://jcp.org/aboutJava/communityprocess/final/jsr121/index.html"&gt;JSR 121&lt;/a&gt;. The JSR 121 provides a very attractive model for isolation but is very intrusive for the programming model, just like a multiple process model. Once you go to a different memory space all your calls need to be &lt;i&gt;marshalled&lt;/i&gt;. Marshalling is the process that moves the parameter objects over the process/isolate boundary. Isolates provide a very efficient socket like interface between isolates but it still means you need some form of serialization or proxying of &lt;i&gt;all&lt;/i&gt; your obejcts that cross the boundary. This tends to be very intrusive for object oriented code. It also adds at least a time penalty that is at least a number of magnitudes over normal method calls. There is obviously also a significant memory penalty running code in multiple processes or isolates.&lt;br /&gt;&lt;br /&gt;These penalties are such a pity. Java is a language that pioneered (as far as I know) the concept of &lt;i&gt;security&lt;/i&gt; on language level. One of the great promises has always been to run the code from different parties in the same VM and have them protected from each other while collaborating when necessary without cost. I really do believe we have come quite far with a standard VM and adding OSGi brings us tantalizing close to this goal.&lt;br /&gt;&lt;br /&gt;Therefore, the first research challenge I post to the research community is to create an OSGi platform that provides the advantage of direct method calls but allows a bundle to be safely stopped and removed from the VM, even if other bundles do not cooperate.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;OSGi Resolver&lt;/h2&gt;&lt;br /&gt;Some OSGi installations can have thousands of bundles. During the booting of the framework, these bundles must be wired so that there imports and exports match up in a consistent and optimal way. This is a task that is on the critical part for startup so performance is at a premium.&lt;br /&gt;&lt;br /&gt;Why optimal? Isn't good good enough? Well, no. The hardest part addressed in OSGi frameworks is &lt;i&gt;sharing&lt;/i&gt;. Most of the OSGi framework is setting rules about this sharing and enforcing them where possible. However, these rules allow considerable leeway in the solutions that the &lt;i&gt;resolver&lt;/i&gt; can use. This is necessary because many correct solutions cause the class space to be split between bundles. That is, one bundle can no longer use the services from another bundle because the packages they use for the service or used classes/interfaces come from different bundles. For example, one bundle uses version 1.0 and the other bundle uses version 2.0. Once this happen, these bundles live in different worlds and can not easily collaborate. The resolver must therefore find solutions where packages are shared as much as possible.&lt;br /&gt;&lt;br /&gt;A couple of months ago we had a big discussion about this problem, Thomas Watson (IBM) posted the question if the resolver is an &lt;a href="http://en.wikipedia.org/wiki/Np-complete"&gt;NP-complete problem&lt;/a&gt;. We had some very interesting and long conference calls (software engineers love this stuff) and I do not think we found real proof for this statement. However, we clearly all agreed it is a hard nut to crack.&lt;br /&gt;&lt;br /&gt;So I pose the second grand OSGi challenge: Provide an OSGi resolver that can resolve a set of bundles in linear time, or prove that this is impossible.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Multiple Versions&lt;/h2&gt;&lt;br /&gt;The most attractive property of R4 is clearly the fact that it can support multiple versions of the same package in the same VM. Though one should &lt;i&gt;never&lt;/i&gt; design a system with this in mind, it is a life saver when you discover two of your bundles require incompatible versions of the same package. And with today's development model of tens if not hundreds of open source products it is almost guaranteed that you will need it.&lt;br /&gt;&lt;br /&gt;To allow bundles to collaborate, packages must be shared. It is therefore very beneficial to maximize the flexibility in imports. This is the reason that one can specify a &lt;i&gt;version range&lt;/i&gt; for an import package. This range indicates that this bundle can operate with a set of packages. Great! But, ehh, how does the developer manage this?&lt;br /&gt;&lt;br /&gt;Normally, there is only a single version on the classpath during development. Tools like PDE, Maven, or JDT provide no support for adding a version dimension to the classpath. The direct result is that many people compile against the latest version. If they use &lt;a href="http://www.aqute.biz/Code/Bnd"&gt;bnd&lt;/a&gt; they automatically get an import statement (provided the exporter is a properly marked up bundle) for this latest version. If this has to be maintained by hand then it is even harder. The developer must intricately be aware of what is using what. Import ranges are really hard to set properly because they explode the number of combinations that must be tested. Trying to do this by hand is painful.&lt;br /&gt;&lt;br /&gt;As an aside, I believe life would have been easier if we