Book Review: Modular Java

Modular Java by Craig Walls is a book on building modular Java applications on OSGi platforms.

Published in the Pragmatic Bookshelf series it keeps up to the standards of that great series by presenting content that matters in a format that makes you try it out immediately.

OSGi’s value proposition is to keep complexity in software products manageable. It keeps modules isolated from each other and encourages loose coupling through publishing and consuming services. You can think of OSGi as an incarnation of service oriented archietcure (SOA) within the Java Virtual Machine. OSGi has its roots in the embedded systems environment and became popular for desktop applications with Eclipse using it as their core infrastructure. From embedded to desktop OSGi is currently coming to the server side.

Craig’s book introduces the basics of OSGi, shows how it isolates modules by its unique approach to classpath handling and gives you an overview of the concept of OSGi services. One easy to follow example application is used consistently throughout the book to show the various aspects.
Most of the time the book uses Equinox as runtime but Felix and Knopflerfish are also mentioned. For building bundles Modular Java makes use of Pax especially Pax Construct. It does not mention Bundlor, Bnd or Tycho in depth. Especially the Maven based Tycho stack sounds really promising so it’s unfortunate that it isn’t covered. I guess however this is just an attribution to the current speed of development in the OSGi tooling space.

Spring Dynamic Modules are an attempt to bring the principles of Spring Framework to OSGi. In the spirit of Spring Framework Dynamic Modules (DM) build on proven solutions (OSGi in this case) and make them easier to use. They eliminate a lot of boilerplate code that is normally require to handle OSGi services that may appear and disappear at any time. Spring-DM also provides integration with Spring Application Contexts and has support for web applications through an extender. Spring-DM is covered really well by the book. An appendix describes the new OSGi Blueprint Services that are an attempt to standardize the ideas of Spring-DM. Spring’s new dm Server is not covered.

The book focuses on the core concepts and shows the benefits of using OSGi for application development. The target audience are experienced Java developers. It is very well written, easy and fun to read and serves as a great introduction. I recommend the book to Java developers who consider making use of OSGi in future projects.

Book: Openfire Administration

Packt has released a new book on Openfire a Java based Instant Messaging server.
Openfire Administration by Mayank Sharma is a step-by-step guide for everybody who wants to setup an internal IM server for private or corporate use. It walks you through the whole installation and configuration process including integration with external authentication sources like OpenLDAP and Active Directory and covers a bunch of useful plugins.

In contrast to other similar products Openfire is based on open standards as it uses the same XMPP protocol that is also used by Google Talk and Apple’s iChat. Openfire is available under the GNU General Public License so there are no license fees and it’s maintained by a vibrant community. There are a lot of free and commercial clients that you can use to connect to Openfire like Spark and the Flash based SparkWeb, Psi, iChat and many more.
Additional free plugins are available that cover a wide range of requirements like connection to other IM networks like MSN, ICQ/AIM and Yahoo!, server side archiving for compliance and integration with the Asterisk PBX.

If you are new to running IM infrastructure and interested in setting up a proven enterprise ready solution Mayank’s book is for you and will provide you with the information required to install and run a professional IM solution.


Book: Release It!

Michael T. Nygard’s book on releasing resilient enterprise software is a nice mixture of real world case studies and hands on tips for designing robust applications.

The book is organized in four parts:

  • Stability
  • Capacity
  • General Design Issues
  • Operations

Each part features case studies, patterns to apply and anti-patterns to avoid. For stability Michael advocates cynical software:

Cynical software expects bad things to happen and is never surprised when they do. Cynical software doesn’t even trust itself, so it puts up internal barriers to protect itself from failures. It refuses to get too intimate with other systems, because it could get hurt.

The patterns to achieve the decoupling include “Use Timeouts”, “Circut Breaker” and “Fail Fast” — things you’ve probably already applied from time to time, summarized and put into context.

Technology is centered around on what you find in today’s enterprises: Java EE app servers like Bea Weblogic, Oracle databases, Big IP F5 load balancers, Veritas Cluster Server, Sun boxes with Solaris from small V440s to the large E25K.

The book is focused on architecture and design so you will find only a few code snippets to illustrate concepts or specific flaws. It’s neither a cookbook for the developer nor an academic paper that sells a methodology. Instead it contains hands-on experience and provides a good overview of the areas to look for to avoid common pitfalls when designing resilient applications for today’s enterprise environments.

Available at Pragmatic Bookshelf.