The System designer’s dreamImagine one day your boss comes into your office and say: “Hey, I’m feeling happy today, here’s 10 million dollars, do something useful for me and mankind for a year and let’s talk again after that. If it seems good you’ll get another 10 million.”BackgroundYou might not believe there could be such a situation, but never mind that. Let’s just play with the thought. You might not be up to such a task, who would? But, you’d have nothing to lose and let’s say also that you could be the software dictator of the world demanding unrestricted obedience. Let’s also say that you’re not Charles Montgomery "Monty" Burns of the Simpson’s. Seriously, what would you do for the benefit of mankind that would surely render you another 10 million dollars?
What to do with itSince you have been struggling with software development half of your grown up life, let’s see what annoys you the most. First in mind might be to invent a decent test-editor and finally get rid of that Notepad on your windows system or that VI for that matter. Wait a minute that must have been done already. Maybe you could develop another Operating System? That would be pretty cool, and then just hand it out to the world for free. Nah, that’s been do too I guess with Linux. How about creating a new protocol for distributing software? It could be called File Push Protocol. You’d wake up every morning with you separate hard drive full of good stuff that others have given you. Nah, maybe not, that might be illegal even. Something old, something new, something, borrowed something blue… Suddenly, you might think of a new programming language, like another XML-standard and start then wondering why we need all these standards. Wouldn’t it be great to do something that everyone could use? And that could be run on all types of devices? Implement once, run anyway. That sounds a bit like Java. Maybe a new programming language should be invented? An operating system developed in Java? Nah, but, it would be nice if one could take advantage of all code and libraries that is out there, so maybe an operating system that hovers on top of everything?
I have no idea what runs through your head at the moment, but doesn’t that seem to be a good idea? Let’s use what have so far developed and see if we can create something that runs on top of the Java Virtual Machine that would work like an operating system. Not in the computer itself but mainly in the Network the computer is connected to. Let’s see if we can find something useful in between the client, the server and the network. Let’s see if we can find something interesting in between the WAN, LAN and the PAN that could benefit mankind.
Problems
When we send data between devices we need to use protocols. There are hundreds and hundreds of protocols out there designed for every little purpose. How can we communicate with all kinds of devices seamlessly and without inventing a new communication standard?
There are hundreds and hundreds of different API’s and libraries out there, how do we communicate with these seamlessly and generally speaking?
One of today’s major problems within software development is the cost of developing new software. Code is seldom re-useable and system developers tend to re-invent the wheel all the time, if it’s not for legal problems it’s for design or reliability problems. How do we ensure that we create software that can be re-usable, can be replaced, repaired and enhanced?
How can we find a way to be sure that we are creating building blocks that can be run anywhere on any device?
The terms “block” and “components” describes rather stiff and fixed properties. Let’s call it services instead. Like a waiter that provides a service. Or your best buddy. Let’s make best buddy software. And, I almost forgot, since we can dictate, let the best guys in the industry from every vendor come and make suggestions on how we should do it.
India, we have a problem
Dear India, if you don’t have anything else to do, help us with this and let’s get this train going. We are not sure where we are heading but we’re sure it’s somewhere better than where we are now! We have a great idea, but we don’t really think we can pull it off for even 10 million dollars. Can you do something with the money? And if you don’t mind, we’d like to take credit and make it our very own brainchild. Let’s fix this industry once and for all and make sure we can all create standardised services that truly will run anywhere, all the time and on any networked device. Let’s hand it out for free and see if we can create a revolution that will rock this world in its foundations!
One year later...Ok, let’s slow down and stop imagining now. Let’s get serious for a moment. After all, we don’t have the money and why would companies adopt the standard just like that? It surely couldn’t work. Or can it?
Where do we stand today?
Actually, there is a standard implemented since around 1999 (it’s not Indian). Beginning with all major software companies – except for the Company, they didn’t need any expert help – an independent organisation started to sketch on a solution that roughly would be able become a solution to any known problem in computer science. How is it working then? Fundamental is Java that runs on any operating system, Java also nowadays runs in very small devices like a telephone for example. On top of the Java Virtual Machine runs a framework, where you can install, start, stop and uninstall services – remotely if preferred – on the fly. The services offer a Java interface to the framework. The interface is the service. Anything that implements that interface is hidden from the other services. So the only connection to the service itself is the interface that is open, public, for free, usable and preferably it’s very clean and simple.
A few words on what is done
So how do we handle different network protocols that we might need to speak? We implement a service for each protocol. This way we are sure of not inventing another protocol, and we are sure of that we can speak native whether it’s an internet protocol or an application protocol or something else.
How can we be sure that we are building services that can be re-used? It’s really a design question. Implementing a protocol is quite easy. What do we do with services like logging and storage of a service’s preferences? If some services are so typical that a program will always use them, they could be implemented once and for all. That would also save memory space. The framework must be able to start and stop services so we need to handle recently started and stopped services. We have to have a really nice class loader that can find implementations of a service on the fly. Since many different versions of the same service might exist in the framework we need to handle this in a good way.
Java guarantees a lot when speaking of where the service could run. Not to mention all different kinds of security layers that is provided. So there is a standardised framework out there together with some basic system services. What is it then?
OSGi Alliance’s solution
Let’s see now, it’s an open, standardised execution environment for networked devices. It’s a magical machine that could help any application or device or appliance getting in contact with the rest of the universe in the network - WAN, LAN or PAN.

©www.osgi.org
Once you have your special service into the framework you’ll have access to other vendor’s services, if you have installed any that is. If you are in the device making business and have a little device that measures indoor temperature and you have a driver for a desktop PC, you could easily make it OSGi compatible by replacing your main method with the OSGi start-method, bundle it in a Jar-file and adding it into the framework. If you have your driver in C/C++ you can use Java anyway to get it into the framework. With that you could for instance use an SMS-gateway that of course is installed and connected to the desktop framework somewhere in the network. Whoops, all of a sudden you have a lot more to offer than a device that reads the temperature!
If you have a major application like a Network Management System, why not offer and OSGi-service as well, making your NMS-API available for other vendors? Of course they will provide an OSGi-service if you do and “Whoops” again; you can manage all kinds of devices that you didn’t support before. Plus you’d have the opportunity to speak any protocol you’d need and would be able to present whatever you’d like to present on any kind of equipment connected to the network. Provide your goods and let the others provide theirs. Everyone would play in the same arena, on the same terms.
Why don’t we?
God knows, implementing services are one thing that seems to be catching on at least. We are limiting ourselves to creating services that runs in service oriented architectures. We are limiting ourselves to making services as Web services. At least we have found some common standards when communicating. It might just be enough at the moment, but we still lack of openness, collaboration and cooperation. And all systems that only run on one operating system? What a complete waste of resources building systems that are locked to a certain processor and a certain operating system and a certain vendor.
So, is there a lesson to be learned here? One might be that no matter how good you do it, you still will have difficulties finding acceptance due to the fact that it’s a competition out there that is killing. There are two many examples of situations where the products, systems, protocols or whatever that are second or third best for all of us have been the ones that have been accepted as standards.
We still have a long road ahead of us, just at least have in mind that someone has probably already done exactly what you are about to do next… Lastly, which programming endeavour would you put your money on?