OSGi in Action: Creating Modular Applications in Java

Book review

Researching around the web for content that could make developers' lives easier when dealing with Liferay, we came across this book that called our attention due to the strong reliance on OSGi that marks Liferay 7.0 development.

From the book's publisher web page (https://www.manning.com/books/osgi-in-action) you can read the following description, which is our starting point for this review.

OSGi is a Java-based framework for creating applications as a set of interconnected modules. OSGi lets you install, start, stop, update, or uninstall modules at execution time without taking down your entire system. It's the backbone of the Eclipse plugin system, as well as many Java EE containers, such as GlassFish, Geronimo, and WebSphere.

OSGi in Action provides a clear introduction to OSGi concepts with examples that are relevant both for architects and developers. You'll start with the central ideas of OSGi: bundles, module lifecycles, and interaction among application components. With the core concepts well in hand, you'll explore numerous application scenarios and techniques. You'll learn how to migrate legacy systems to OSGi and how to test, debug, and manage applications.

Liferay 7.0.x came with a complete shift in how plugins are created, even though legacy methods are supported, the new documentation pages are coming up with OSGi in the spotlight. The technology or methods are not particularly new, but the highlighting of OSGi as the bases for extension and customization is something recent in this EE platform.

If you came from Liferay 6, you probably know the book entitled Liferay in Action, which does not provide much help to understanding OSGi patterns and the framework's unique ways. And that is one of the main reasons we went out to search references that could help engineers adapting to this new reality.

Among the sources, this book has proven to be one of the best references to fully understand how the platform behaves. As the tiny tutorial based on Liferay's website is only enough to get you started, often one might see obscure errors or odd events that require a better conceptualization to be fully understood. 

OSGi in Action is not only a book that is guaranteed to take you from the beginner level to be at lease a proficient developer, but it covers the concepts in depth, showing not only how, but why we do things the way we do.

The down side is that this is a massive book! If you are used to this series, you will notice that it is a bit chubby. And the main reason is not around the depth of the discussion, but that writing style that keeps summarizing what you have just read and what you will read, in every single section. It becomes quite frustrating sometimes times. Moreover, for a book that discuss modularity, this book could use some in its huge chapters.

The upside though, is that the book uses an extremely simple language with trivial examples to clearly make its point.

Overall, it is a great book to have around. And although is does not trace a great case for modularity, it does provide the basic argumentation to support it. Further, it definitely shows what the framework is about and it is able to teach in a crystal clear language how to build systems, for architects and developers, as stated in its cover. It gets boring sometimes, but worth the effort, even with its age.

More Blog Entries