Tuesday, 27 December 2011

Book Review: OSGi in Depth

OSGi in Depth Cover
A few weeks ago I got my hands on OSGi in Depth from Manning. The book is well written and I would give it a 4 out of 5. The book is not targeted for beginners but rather to developers who know the basics of OSGi and are now planning to develop an enterprise application using OSGi. I found the introduction to OSGi slightly lacking in my opinion, however the rest of the book discusses topics which are very interesting and which I had a hard time to find details elsewhere.

The first 4 chapters introduce OSGi and the case study. The interesting parts start from chapter 6 onwards. Chapter 6 introduces events and how they can be used to decouple your modules. I found chapter 7 very useful since it discusses how to do persistence in an OSGi environment. This chapters discusses how to make available database connection factories without needing to import the specific packages and how to do JPA. I will be using this knowledge pretty soon in a project I am working on so I am quite happy to have found this topic discussed in detail here together with the accompanying lab.

Transactions are discussed in the following chapter, chapter 8. What I found interesting was not the discussion about transactions but rather how you can create a container to delegate the transactional related calls to the container instead of having it scattered in your business logic. The method introduced here will be polished as we go through the book, but what I found interesting was that the author showed that any behaviour that you want shared across bundles can be packaged nicely in extensions that can be applied to the bundles through facilities that OSGi provides. I found this refreshing and made me look at OSGi application development in a different way.

Chapter 9 discussed how OSGi can be made to work with JavaEE through JNDI. This was quite an interesting topic but not much to me personally. The same I can say about chapter 10, well written but I typically would use some other mechanism to invoke remote services, but, never the less it was interesting to see how one would invoke remote services using OSGi. The following chapter grabbed my interest again. Material about the best ways to deploy OSGi applications is slightly limiting. The discussion about how to handle misbehaving bundles was quite interesting, but something that I will be probably using is the File Install which the author introduced here. The file install gives you the possibility to manage you application bundles in the same way as you would manage your web applications through an install directory. For more information you can read about the Apache Felix File Install here.

The JMX discussion in chapter 12 was interesting but not as good as chapter 13 where the author extends Blueprint. This was a very interesting chapter cause it shows a very good way of packaging code that cross cuts multiple bundles and how to have it declaratively applied to the business logic in these bundles. The discussion about blueprint is limited, in fact the author directs you to the book OSGi in Action for a more complete discussion of blueprint. However I believe that the author fills in a gap since he explains how blueprint works underneath the hood and shows how you can do a similar extension, but finally this extension is integrated nicely with blueprint, including a custom XML namespace. In short, reading the entire book was worth it for the final chapter!

To wrap things up, this is quite a good book for anybody who wants to implement enterprise OSGi applications. If you are a beginner and would like to learn OSGi for its own right, I would go with some other book, however, from this book, I would say that the chapters about persistence, transactions, deployment and blueprint are very useful. I also liked the way that the author focused on showing how to create application containers which run on OSGi in which you can run your own custom applications. I guess that is why the author called the book, OSGi in depth.

Tuesday, 20 December 2011

My First Blog

This will be my first blog entry, my first of many hopefully. I thought I would start with a brief description of who I am and what I am interested in. As you might have guessed, I am interested in anything which has to do with Integration and any other garnish which might go well with such topics.

I was introduced to integration and open source in my third year of University when I got employed by Ross Mason the creator of Mule. After that summer, I was hooked, and will always have a soft spot for Mule.

After 5 years of working with Mule and everything related to it, I changed company and the focus shifted to Servicemix. I must be honest, I was slightly hostile to "ServiceMix", however luckily it had past the JBI phase so the combination of OSGI powered by Karaf and routing powered with Camel is quite appealing. So probably my interests will focus a bit more on OSGI.

I am also interested in other topics and technologies. I think I am right now a big fan of Spring Roo, especially with version 1.2 coming up with the Services and multi-module support. I also like to thinker with Android and GWT. Something that I am looking forward to right now is to have some time to play with Vaadin since the creators are just a 2hour train ride from Helsinki in the city of Turku.

Well, I hope you will find interesting topics in this blog and find this blog interesting!