Fork me on GitHub

Sunday, August 17, 2008

Getting your toolbox ready for OSGi

Getting your toolbox ready for OSGi

This is my second post on OSGi. In my previous post, I just mentioned about what OSGi is all about. In the coming posts, I will be explaining on developing OSGi applications. As before, I won't be repeating anything that has been already written so well by other authors. I will be just siting some links to them. I will try to be innovative by linking thoughts in various articles or adding a missing point to the existing article, or giving a new way of doing things.


But, before we begin out on expedition and get our hands dirty on developing OSGi applications, let us pack up our toolbox for it. However if you are too eager to getting a feel of developing applications on OSGi, just read on this article by “Neil Bartlett” on EclipseZone.


There is nothing special that you need in developing OSGi application, other than an OSGi platform implementation jar to your regular Java environment and a simple text editor. Still, we all like tools in our day-to-day life to make things easy. With this post, I will just try to get ourselves acquainted with the tools that will make our life of developing OSGi applications simpler.

Eclipse

Eclipse is my favorite IDE for Java development. Although you can use can continue to use your own favorite IDE, if you are not already using Eclipse; there is more to using Eclipse. Eclipse itself is build on the Equinox runtime that is an OSGi implementation platform, and Eclipse allows to interact with the Equinox runtime. And sometimes its really very easy to developing your bundles in there.


Eclipse calls the so-called OSGi bundles as Plug-in, and the environment it provides for developing these Plug-ins is called Plugin Development Environment popularly called as PDE.

Maven

Maven is basically a build management tool – like the Ant, but much much more. Maven can manage a project's build, reporting and documentation from a central piece of information provided by the POM file.


Maven is popularly helpful for its dependency management. It allows a project and all its dependencies to be managed gracefully. The variety of maven plug-ins that are available makes the usage of Maven even simpler to be used for most of the odd kind of projects.


If you are new to Maven, it may feel a bit intimidating, at first, but you will soon feel very comfortable with it and would always think of how could you make use of Maven to make use of your tasks easier. I will not talk more on this – there is enough written on Maven.


Although we could use Ant, the simplicity given by the Maven is just enough to make us learn Maven if we don't know it already - its simple. Believe me!


We will be using the power of Maven to simplify many of our tasks for OSGi.

Pax Projects

Probably the most important tool in your box for the OSGi world would be the set of tools provided by the OPS4J under the Pax project – an umbrella project for all the OSGi projects at OPS4J. OPS4J was probably one of the early adopters of the OSGi, and therefore what they provide is worth the time they have spent on it. There are several projects under the Pax, all geared to making your OSGi life simpler, without any hype attached.


I would have loved to write on the tools provided by the Pax projects, but Craig Walls has made my job easier by posting exactly the same on his blog few days back. So I would just like to refer to it apart from looking at Pax official site.


And if you are wondering where to begin from on the Pax tools, just start on the pax-runner, pax-cursor and pax-construct to begin with.


The version numbers of most of the projects should not make you upset. You will find that most of them are still having a major version of '0'. Probably this is one of their strategies that indicates them avoiding the hype. I don't want to create any hype either, just check it out yourself. And if you find any place that needs improvements, feel free to do it right away, after all OPS4J is not just about liberty of source, its about a community participation.

Spring & Spring-DM

We will be using Spring for what it is popular for – Dependency Injection. Spring-DM (Spring Dynamic Modules for OSGi service platforms) is another project from Spring Framework specifically focussed at OSGI. Probably we all would like our code to work not only in OSGi, but also in other environments as well. In designing such an application, you would probably do not want your domain objects to be coupled with the OSGi API.


That apart, just like Spring provides us with some great tools and utilities to getting our developer life easier, Spring DM will also provides some tools and utilities specific to OSGi, apart from the dependency injection aspects specifically for OSGi.

Whats Next?

Once these tools are at our box we will be in a better position to learn more and develop OSGi applications easily. Its not about mastering the tools above, but knowing about them will give us a holistic understanding of developing OSGi applications easily.


In my forthcoming posts, I will be using up these tools to develop OSGi applications.

Monday, August 11, 2008

Thinking beyond liberty of Source...

Thinking to start or contributing to Open Source project ...?

Have you ever wondered at the richness of the Wikipedia, the amount and variety of information it contains? You can think to find there almost everything under the sun over there,.. and if you don't, you can always add it there. Great, isn't? All this richness was possible only because people all around the world can participate in authoring the Wikipedia. One can never think of such a great encyclopedia being authored by one or a few authors. You can always create new pages, edit or add to the existing ones and thus add to the richness of the Wikipedia.


Now think of the same richness and flexibility being brought to the Software world. Wow! that would be fantastic!! Yes, OPS4J provides you this flexibility with the philosophy - “wiki brought to coding”.


Here is the reproduction of the OPS4J philosophy from their wiki's home page:

OPS4J stands for Open Participation Software for Java, and this community is trying to build a new, more open model for Open Source development, where not only the usage is Open and Free, but the Participation is Open as well. Removal of barriers, let more people in, have more fun and less politics. I have also seen Open Development as a term to describe this.


Think of it as Wiki brought to Coding. Wikipedia is of course the most outstanding example of open collaboration.


If this is your first visit to OPS4J, we recommend you the Introduction.

What is “wiki brought to coding” ?

Wikis that drive the Wikipedia is a collaboration tool where contents or media could be added, edited and updated by virtually everyone with valid credentials. However Wikipedia just allows this credentials to anybody who just registers with it – no special merit is needed for you to obtain the credentials.


While both the philosophies of FOSS – Open Source and Free Software promote the openness in the software source and the liberty of the user to modify and redistribute the software without royalties, none of them actually dictates the ways in which someone could actually be a part of the project itself.

Beyond the FOSS philosophy

OPS4J extends the concept of wiki into the software world. You just need to register with the site and then you can create, modify and contribute to the software or its documentation.


The site itself is wiki-based, meaning that once registered, you can add and edit wiki pages that make up the site – just like Wikipedia. You also have write access the SVN, meaning that you can create your own projects, or add to the existing ones. So,.. no more patch submissions and waiting for you to prove yourself to be meritorious to have the write access to the SVN. Whats more – you also have almost an unrestricted access to the JIRA too!


Its a home away from home for a developer. You have access to almost all the tools and rights needed to operate a software project. The whole world seems to be your team.

Why this “No Barrier” approach to Open Source?

There are already Open Source promoted by organisations such as Apache, SourceForge, JBoss and the like, but they do not adequately allow everybody to participate. These projects are either merit based, privately owned or commercially controlled. They have their own way in how it restricts people from participating in the software evolve.


These and similar thoughts on its philosophy is explained clearly here, and at the links given at the references.


It also answers few other questions that maybe coming up in our minds such as:

  1. Why does "No Barrier" projects make sense?

  2. When does a "No Barrier" project not make any sense?

  3. How about the bad guys (trying to destroy the code bases)?

  4. How does it work here at OPS4J?

  5. Who is in control at OPS4J?

  6. As a user, what licensing applies to me?

  7. What can I do to make OPS4J better?

  8. I want to start sharing some code and invite others to help out. How do I do that?

  9. I have found a bug in some code, what shall I do now?

Conclusion

Essentially the OPS4J is right in its innovative philosophy to promote Open Source that is essentially liberal. All those who have worked behind this upcoming idea has to be given all the credits.


So what are you waiting for? Just jump ahead, create your account and start participating and see your ideas grow and mature!

References

OPS4J itself has much to say about the philosophy of “No Barrier” and “Open Development”, and how it tries to implement them. If these ideas excite you, please make sure to go through the following links.

  1. http://wiki.ops4j.org – Home Page

  2. http://wiki.ops4j.org/confluence/x/mYE6 – Introduction

  3. http://wiki.ops4j.org/confluence/x/Cg – Community Tour

  4. http://wiki.ops4j.org/confluence/x/Cw – Principles of Open Participation Software

  5. http://wiki.ops4j.org/confluence/x/D – Practicalities at OPS4J

Monday, August 4, 2008

Open Source with Liberty

How many of us know that Open Source softwares essentially are Free Software as well (most of the time)? Again, if one has read the definition of Free Software? See http://en.wikipedia.org/wiki/Free_Software and http://en.wikipedia.org/wiki/Open_Source.

Okay, I will give it out brief. Free in the Free Software as with its philosophy defines "free" as in "free thoughts" and not as in "free beer". Essentially what makes a software Open Source or Closed Source or Free Software is determined by the license that it carries. But when most of the licenses (almost all the popular ones) that qualify for "Open Source" also qualify for the "Free Software", essentially the software that carries such a license is essentially Open Source as well as Free Software.


NB: If you don't understand something as you read on, just open up a new tab on your browser and do a search on the subject, you will find so many good links. So much has been already written on the subject that I find it pointless to write them again. Please guess it right that I am too lazy to give out those links here. Hope you can excuse me for that!


Even while most of the software qualify under both categories, its authors and promoters try to push it as Open Source, and not Free Software. Why? Popularity ... branding your software as being "Open Source" makes it more popular than branding it as "Free Software". Try to imagine a software that you have used and was promoted as "Free Software". Can't gain much... right?


I am not being paid by Eric S Raymond or OSI, neither by Richard Stallman or GNU or FSF, so I should make a clear stand on both. While there are very narrow differences in the qualified Licenses for the two, they differ in their philosophies to where the emphasis goes. While the Open Source philosophy emphasis is on the openness of the source (of the software), Free Software emphasis is on the liberty and freedom on the software that you use. As the FSF/GNU site mentions it, Free Software and Open Source are not enemies, but rather closed source is the enemy.


Why did I write this post?

As I talk to my friends and colleagues, I understand that not many understand FOSS/FLOSS (addressing the Free and Open Source Software in a single name) in the real sense. For many, free software is something you don't have to pay for, and in that sense, open source is also free. And Open Source is something where you can see the source. To people like them, while at least when they read this line, they must realize that there needs to have a more thorough understanding of the FOSS/FLOSS philosophy.

There are good number of essays on this topic, but I thought of writing this post to save some of your time reading it. But if you are a bit more free, just read this one to understand some differences between the two philosophy. (Okay, this will not explain why most people prefer an Open Source branding as such, though it explains that "open source" is considered as a "marketing" campaign for free software).


There is so much to write on the subject, but this is a comparatively small post because:

  1. I am lazy in writing essays.
  2. I am not good at essays.
  3. People often don't have time to read essays unless its really critical, and I understand that the need to understand FOSS is hardly ever critical unless you are selling a software with a sprinkle of FOSS around threatening your own license.

I try to promote FLOSS as I deal with people personally, but for others, some of my posts like this should help. Just post on a comment if it helped a penny on your thoughts to know FOSS.