Monday, December 26, 2011

Book Review for "Java EE 6 with GlassFish Application Server"

I work with Enterprise Java a lot. I'm a support engineer working in the SOA workspace. This means I get regular exposure to web services, JMS, and other parts of the JEE stack. But here's the thing-- I almost always work with the same parts. For every part I usually work with (JMS, SOAP web services), there's at least one other part I don't work much with (JSF, RESTful web services, web-tier stuff.) So what's happened is I have become well versed in parts of the JEE stack, but have failed to keep up with the rest.

I chased the Enterprise Java rabbit all the way down the hole back in the J2EE 4 days. Quite a bit of what I learned then-- early EJBs, enterprise patterns, and so on-- is now thankfully useless. I knew there were lots of programming productivity-enhancers put in since JEE 6, but I just didn't want to take the time to read the internet again to once again become whole-stack proficient. So I picked up a copy of "Java EE 6 with GlassFish 3 Application Server" by David Heffelfinger.

I'd read David's work before, so I was expecting an easy to read book that contained plenty of minimal examples I could run and experiment with. I wasn't disappointed, this was exactly what I found.

The book divides the JEE stack into slices and explains each in turn. Each chapter contains several Maven-driven examples that can be easily compiled and quickly deployed. In this regard, the book does exceptionally well.

The first chapter is really basic-- downloading the tools you need, and a quick overview of GlassFish.

The second chapter covers Servlets. There are several basic examples that show web tier basics like extracting HTML form parameters, saving data in scope, and forwarding requests. There are also newer features like web-xml fragment processing, asynchronous processing (good for AJAX), filters and annotations instead of configuration. This chapter reminds me of an old book I learned a lot from, "Core Servlets and JavaServer Pages". Did you use that one? This chapter has the same ease of reading and practical applicability.

Chapter 3 was again a lot of basic web-tier stuff. JSP fragment includes, Custom Tag Libraries, Unified Expression Language, XML syntax and JSP syntax are covered. Reading this taught me a few new things, validated some of what I remembered.

Chapter 4 was about JSP's Standard Tag Library, including core features (i.e. iterator, looping, etc.), formatting (I18N with bundles), SQL, using XML JSTL (instead of JSP), and JSTL functions like split(), length(), toUpperCase(), etc.

Chapter 5 was the JPA chapter. I've done a little JPA work, so I'm not totally stuck in the Entity Bean era, but it was nice to have this chapter to outline modern Java persistence. In particular, the explanations of entity cardinality and the way to use annotations on your entity classes was well done.

Chapter 6 covered JSF, which was something I needed. I remembered the old Servlets and JSP way of doing things, but I haven't been in the web tier a lot since JSF came around. This chapter Explained tags, validation (including custom validation) and error messages. The explanations were easy to follow and very well done. I was especially happy to read the section on combining JPA and JSF, as it shows how sensible defaults connect the JSF page to a controller bean. Hurray, JEE can do a lot of wiring for you, using sensible defaults! (Once you understand what they are, it's easy to see how a few lines of code can accomplish a lot. But if you don't know what the conventions are, you'd have a hard time guessing what can be done for you by JEE!)

Chapter 7 was a JMS chapter. I work here a lot, so there weren't a lot of surprises for me. For those that don't work with JMS a lot, it'll be good.

Chapter 8 was about JEE security. As usual, well explained. (There seemed to be quite a bit of Glassfish specific stuff here, I wish that could have been reduced.)

Chapter 9 was the EJB chapter. Stateful, Stateless, MDBs, Singletons, Timers. Transactions (and how to have more than one transaction with UserTransaction). Easily understandable, modern EJBs make business logic fun.

Chapter 10 covered Contexts and Dependency Injection. Modern JEE servers are moving into the space traditionally inhabited by Spring, and this chapter explains how to use DI in a JEE container.

Chapter 11 covers Jax-WS web services. I spend plenty of time in this workspace, so I found most of it familiar. You can certainly find aspects of JEE that are not covered in this book (Jax-WS leaves quite a few nooks and crannies to explore), but this chapter covers the basics well.

Chapter 12 was about Jax-RS (REST web services). This is another chapter that illuminated an area I had experimented with in the past, enjoying mixed success. The 'convention over configuration' aspects are explained, which makes example Jax-RS snippets much easier to understand. This is one of the chapters I'm sure I'll refer to in the future.

There are also a couple of appendices, one on email in JEE and one on IDE usage.

The book's about a year old, but JEE 6 is still the current spec and will be on the upswing for quite a while. The book is very much relevant.

So, what's the final verdict? It's a doozy: This book will have a spot on my nearest bookshelf, because it is an excellent and easy to read reference for the whole JEE stack. What makes this remarkable is that I don't even use GlassFish! Ok, for this book I downloaded a copy and kept it right next to JBoss AS 7, my preferred JEE 6 container. It's a tribute to the JEE spec writers that I was able to run the majority of the sample applications with virtually no changes for the app server-- just compile via Maven, then plop the deployable artifact onto whichever server you want. (By the way, if you haven't used one of these new JEE servers yet, you're in for a small, fast surprise! Please try JBoss AS 7, you'll see what I mean.)

For coders like me-- those who don't spend a lot of time across the whole JEE stack-- I'd recommend this book as a quick way to be comfortable wherever you find yourself in the JEE stack.

The book can be found here.

Happy Productively Programming!

Saturday, November 12, 2011

Book Review for "JBoss AS 7 Configuration Deployment and Administration"

Book Review for "JBoss AS 7 Configuration and Administration"

Have you heard the buzz about JBoss AS 7? Happy days for the developer community-- the productivity gains of JEE 6 are combined with lightning fast speed and minimal footprint for AS 7. The downside to all this is there is much to learn (again). Packt can help.

The book's author is Francesco Marchioni. If that name sounds familiar, it should. This is the guy behind "MasterTheBoss", a very popular JBoss oriented developer website. Francesco has also authored well-written books on JBoss AS 5 development and JBoss AS 5 performance tuning, so he knows a thing or two about JBoss as well as how to churn the words out.

This is a "RAW" book, which means it's not yet finished. Some of this is reflected in the book's existing text, but mostly what's here is good. There are a few chapters yet to be written.

So what's in this book? Here's a quick chapter-by-chapter breakdown.

Chapter 1 - A nice overview of the new, improved JBoss. AS 7 is a major re-hang, with the old MicroContainer going by the wayside and being replaced by JBoss Modules and a Modular Service Container. (The most dramatic external changes are very fast startup speed and completely different configuration mechanisms.) JBoss Modules is a big change, and really is explained throughout the book, but your first exposure is here. You're also given a very newbie-friendly explanation of how to download, setup, start and stop JBoss.

Chapter 2 - We start the daunting task of learning to configure the new and improved JBoss. JBoss has always given administrators a lot of options to consider when it comes to configuration, and AS 7 is no exception. Suffice it to say the model is all new, but this book goes about explaining it in a clear way. (Pictures are used where appropriate.) Here we are given an explanation of how configuration now works-- there is a 'standalone' mode and a 'domain' mode, these are covered. A few bread-and-butter items like port configuration, datasources, and installation of JDBC drivers is here. The author's performance orientation shines through in a section that describes the various types of thread pools and how they can be used. The chapter ends with section on the latest messaging system (HornetQ) and Transactions.

Chapter 3 - Chapter 3 covers 'Enterprise' topics, which include the various flavors of EJBs. The book explains their lifecycles and how they are configured (down to details like cache pool sizing). If you're getting the impression this book covers some low-level topics, you would be right. The JBoss Web Container (very similar to Tomcat) is explained. Configuration of the default JBoss logger is covered, as is installation of Log4j should the reader decide to use it instead. Even though this is an administrative book rather than a development book, the author chose to throw in a simple example web application so the reader can have something to deploy. I tend to lag on web technologies (because I work with back-end technologies), so I really appreciated that part. Woohoo, I've used Facelets!

Chapter 4 - This chapter covers the all-new 'domain' mode. Domains are all about centralized configuration of groups of servers, a feature that will be very welcome in large shops and cloud environments. You may think this sounds a lot like the traditional JBoss simple clustering, and you would be wrong. This is something completely orthogonal to clustering! But it's given a good coverage, and by the time you're done with this chapter you'll be itching to go try to define your own domain and work it over.

Chapter 5 - Chapter 5 is about application deployment. The mechanisms you use will differ depending on whether you are 'standalone' mode or 'domain' mode. You also have several ways to deploy JEE artifacts-- these are all explained nicely. This makes for light reading, but the chapter is balanced out by a good section on Classloading in AS 7. If you've done much JEE development (on any platform) you are aware that classloading can be a tricky area. With AS 7, JBoss sought to straighten this out and this chapter explains how it all works.

Chapter 6 - is about the administrative interfaces AS 7 brings you. First, there's a web UI. In my opinion, the web interface is clean and adequate as far as usability, but it lacks depth. The alternative is a command line interface (CLI) that you can use to reach all kinds of nooks and crannies in AS 7's configuration. The CLI demands that you understand a somewhat arcane dialect, but it rewards you with useful functionality. If you know the current JBoss 'twiddle' utility, you should find the CLI very similar.

Chapter 7 - is the clustering chapter. Cluster configuration is explained, including the Infinispan and JGroups components you'll need to understand. Clustering has always been one of JBoss's strong suits, it should only get better with AS 7.

Still yet to be provided (this is a RAW book, remember):
Chapter 8 - on load balancing web applications.
Chapter 9 - Integration with other frameworks (I'd watch for Spring content here)
Chapter 10 - Tuning and slimming. (With the modular emphasis, we should have some very effective slimming available)

So who's this book good for? I'd say anybody using AS 7. (AS 7 will be the basis for the next 'supported' JBoss, EAP 6, by the way.) AS 7 is a major re-hang, so you're going to want a decent guide to learning your way around. I liked this book, and imagine I'll be using it as a reference on a regular basis.

Oh, that last paragraph begs the question: Who should be using AS 7? I think everybody should give it a try. JEE 6 has an associated learning curve, but it's the most productive version of Enterprise Java yet. With the speed and reduced memory footprint, I found that AS 7 is great to run in an IDE like Eclipse or JBDS, allowing me to deploy and start in a flash. I'd encourage every Java developer to give AS 7 a look, and while you're at it use this book as a reference.

The book can be found here.

Happy (productive) reading and coding!

Saturday, October 29, 2011

Book Review for "Drools Developers Cookbook RAW"

A Developer's Survey of the fast-moving Drools project

This review is for "Drools Developers Cookbook" from Packt. This book is currently available in 'RAW' format, which means it's not quite finished. The text is a little rough around the edges, and there are two chapters yet to be provided.

Do you work with Drools, the popular open source rule engine? If not, this is not the right book to get you started. There is no introductory material to get you started. But if you know Drools, this is your ticket straight to the current cutting edge! This book gives pointers and best practices for working with the latest and greatest features.

The first chapter gives you tips on working with rules. You'll see how to write rules in ways outside the usual, how to enable some diagnostic logging, and how to work with rules on timers and Calendars.

Chapter 2 deals with more 'bread and butter' Drools material, but this time not dealing with rules.

Chapters 3 and 4 cover Guvnor, the open source Business Rules Management System. Guvnor, a web app, allows you to author, categorize, and test your rules. This is how you can have business-analyst types write business logic instead of using programmers.

The fifth chapter is probably the most newbie-friendly chapter in the book, it deals with Complex Event Processing. CEP is a way of applying rules over windows of time, so you can express something like "Tell me if there are 100 online purchases in any half-hour period".

Chapters 6 and 7 deal with executing Drools remotely (mostly through 'Drools Server') and integrating Drools with other applications through Spring and Apache Camel. This is very handy-- after mastering Drools, developers sometimes wonder how to apply their newfound knowledge in a practical way. Here are some good ideas for solving that problem!

The two chapters that are not yet provided deal with Drools Planner (a tool for finding optimal solutions to problems like capacity balancing challenges) and jBPM5 (a re-hang of the popular jBPM Business Processing framework). These two will be very important, especially jBPM. I hope the author is putting a special emphasis on these.

All things considered, I find this book to be a good resource for Drools developers. As I've hinted, if you're new to Drools you probably need to start with something a little more basic. But if you're already into Drools, this is a quick way to get get a handle on state-of-the-art features.

The book can be found here.

Happy Drooling!

Friday, October 14, 2011

Book Review for "JBoss ESB Beginners Guide" in RAW Format

An easy introduction to the popular JBoss ESB.

*Disclaimer* I work for Red Hat as a JBoss support engineer and work with JBoss ESB every day. This will allow me to make an informed review of this book, but you should be aware that I work often with the book's authors. Still, you can expect an honest review here.

Primer: What's an ESB? An ESB (Enterprise Service Bus) is a runtime environment that lets the user define services, consume services and route and transform messages. The user can wire together modular services to define desired functionality. ESBs are often used to mediate web service calls-- they stand in between the caller of a service and the provider of the service. From this man-in-the-middle position they are able to transform messages, manage security concerns, enrich messages, and audit activities. ESBs are also often used with JMS. In this context they are transactional, so they can string together a series of actions (including database inserts) that are transactional and can be initiated by a fire-and-forget client. ESBs offer great utility, but usually at a significant technological cost.

This book is the first book offered for JBoss ESB, and is currently offered in "RAW" format, which means it is incomplete and subject to editing as the authors continue to enhance it. The authors are all key contributors to the project, so the knowledge is first-rate. Presentation is also surprisingly good, probably because at least one of the authors is a prolific blogger and thus in good practice. The overall quality of the book is high.

So what's covered in this book? Here's what I would consider the highlights:

- Download and installation of JBossESB.
- Configuration of JBDS (an Eclipse-based IDE for use with JBoss products)
- Introduction to the JBoss ESB quickstarts. This is very important! This is an introduction to literally dozens of minimal, functional examples for JBoss ESB. (Think of them like "Hello World" examples for using different parts of the ESB.)
- Services, including the necessary configuration parts.
- Writing your own functionality for the ESB (Custom Actions). These can be implemented in Java, Groovy, etc.
- Messages. What they are made of, how to validate them, how they are carried on the ESB.
- Message Exchange Patterns (MEP). This is an important concept in ESBs, it determines if your client gets a response or not.
- Passing messages in memory for performance.
- The packaged Services that come with JBoss ESB. Like the quickstarts, this is a huge gateway to lots of functionality just waiting to be picked up and used.

The book's title includes "Beginner's Guide", which is partly truthful. It is a gentle enough introduction that a newbie will be able to make use of the book. But it also includes plenty of coverage of what I'd consider "Advanced Topics". (Remember, I answer support questions on this software every working day, so I think I have a fair idea of what's easy to do and what's not.)

Since this is a RAW book, it's not complete yet. At least one other chapter is promised, on Gateways. A Gateway is a component that accepts messages from sources other than the ESB itself, i.e. external JMS providers, HTTP, SQL, and so on. This should be another good chapter.

Who is this book good for? I'd say any user of JBoss ESB. If you're not yet a user of JBoss ESB, but think you might like an ESB, then I'd recommend this book for you, too.

If you think you'd like this book, I'd suggest you move fast. For the month of October, Packt is offering any Open Source eBook for only $10.99. That's hard to beat.

The book can be found here.

Happy JB-ESBing!

Thursday, September 8, 2011

Book Review "Android 3.0 Application Development Cookbook"

Book Review for "Android 3.0 Application Development Cookbook"

The Android Novice's guide to doing just about anything.

Android 3.0 Application Development Cookbook

This book is presented in Packt's "CookBook" format, which means it is a series of how-to steps that show the reader how to accomplish some task. In this case, the book shows how to program Android devices using the Eclipse ADT plug-in.

Establishing the development environment was a bit troublesome in my case. I've done a little Android development in the past, but the machine I used was underpowered for the emulator, so I decided to set up Eclipse and my Android environment on my Fedora 13 quad-core. The book is of little value here-- pretty much you are told what you need, and are left on your own to get it set up. Luckily, I'm familiar with this sort of task, so things were running smoothly after the initial install and about a half an hour of Google'd help from other ADT users.

In the early chapters, the book is very explicit about how to set up your Eclipse project and which files to edit. The author takes no chances that the reader is unfamiliar with the environment, and spells everything out in perfect detail. Normally, I prefer printed books to electronic, but this is one case where an e-book would've been handy-- for code copying purposes. I spent my learning time dutifully typing in the author's suggestions, though, and was rewarded with properly running examples each time.

The first chapter is about 'Activities', which results in a window being presented on the device. (In my case, the emulator.) You are shown how to make an Activity, how to store state, how to send an 'Intent' (which is like a message that can be sent to another Activity or other receiver). This chapter spells out the steps in complete detail, so the reader should be assured of success if he has his development environment set up correctly. Later chapters omit some of the detail, but you are never given so little that you can't accomplish what you want. It's just the first chapter that sets the basics for the reader.

All the chapters are set up the same way. There is little or no 'academic background', each chapter is a series of step-by-step descriptions of how to accomplish some goal. I think this book will be a very effective reference for development, I imagine many copies will be kept close at hand.

There is surprising depth in the list of tasks this book teaches. Here's an incomplete list, to show you some of the things that are presented:

- Drawing your UI
- Making menus, context sensitive menus, shortcut keys and submenus
- Storing data on internal storage, external storage, the included SQLite database
- Detecting device orientation, using the accelerometer, detecting user gestures and the available sensors
- Communicating with the user through Alerts, progress bars, status bars and dialogues
- Adding graphics, rotating images, and using animation
- Playing audio files and recording video, audio and taking pictures
- Sending and receiving phone calls and SMS messages, using internet content
- Detecting the device location, using Google maps and other mapping skills

Sounds like a pretty cool list, huh? Each of these tasks is shown in a manner that isolates it from other problems, so you are basically shown the way to write a tiny application that showcases just the feature you are interested in.

Readers looking for lots of explanatory text about the big picture are going to be disappointed-- this book is all about getting the task done. In that regard, it is quite effective.

All things considered, I liked this book and would recommend it to anyone who is doing Android development. Beginners will get a decent introduction to some small projects (they'd better be ready to augment their knowledge with the online APIs and other sources, though.) More experienced developers will probably know some of the material, but can surely learn from the wide variety of capabilities explored. Basic skills necessary are fundamental Java, a little knowledge of XML, and a willingness to follow instructions and look for details elsewhere. If you've got those, you can develop for Android with this book.

The book can be found here.

Happy Droid Development!

Tuesday, September 6, 2011

MEAP Review: Spring Integration in Action

A hands-on guide for using Spring's Integration framework.

Disclaimer: I work for JBoss and support JBoss ESB, which can be viewed as a competitor to Spring Integration. This review will cover only the book "Spring Integration in Action" and only the features of Spring Integration it describes.

Spring Integration is a toolkit that fits the needs of Enterprise users who need to facilitate communication between disparate applications. If you're not familiar with the workspace, these toolkits allow the user to perform tasks like the following: read text files in and invoke backend web services for each record in the file; proxy a web service and allow you to alter either the data going to the targeted backend service or alter the response received from it; log http requests to a database; many others.

The book is well-written and describes Spring Integration usage often in terms of the famous 'Enterprise Integration Patterns'. The Patterns are well-known and time-tested methods of successfully achieving tasks, and the book's author does a good job of demonstrating how Spring Integration can be used to implement them.

"Spring Integration in Action" is broken up into 4 areas:
- Background
- Messaging
- Integrating Systems
- Advanced Topics

The 'Background' section has 2 chapters. There's a short introductory section that covers Spring, for those unfamiliar with this famous Dependency Injection framework. I expect most users will breeze by this, but it probably will be necessary for others. The second chapter deals with the "Enterprise Integration Patterns", which are time tested best practices in the Integration workspace. The book does justice to the topic in this chapter, but really spreads a lot of the 'Pattern' information around the rest of the book as well.

'Messaging', as the section title suggests, deals with the fundamental parts and pieces that help Spring Integration shuffle data from component to component. Integration toolkits require ways to pass messages along (Integration is mostly about messaging), in Spring Integration these are called "Channels". Channels are very important in Spring Integration, as they determine the runtime characteristics (i.e. number of threads) that will be part of your pipeline. This can be a topic of confusion, so it's good the author discusses it early.

Components deal with messages, messages travel along channels. In between these two is an 'Endpoint', another important topic. Endpoints can be outward-facing (gateways), and can be event-driven or polling in nature. Endpoints are covered in the same plain-spoken manner as the rest of the basic components.

The next few chapters deal with more 'generic' Integration best practices. These include the way messages are transformed (so different systems can 'talk'), the way messages can have information added to them, and how you can route and filter the messages that travel between components. If you've been in the workspace, this all probably sounds familiar. If you haven't-- the book provides a good explanation of how things work.

'Integrating Systems' deals with the construction of your message pipeline and some of the components you'll likely need. You'll be wanting to split and recombine messages, convert Java objects to XML (and vice-versa), and how to hook JMS into your pipeline. You'll also want to deal with the file system, web services and maybe email-- these are all explained here.

'Advanced Topics' is a potpourri of topics that you may or may not find a need for. It seems most every book today has to cover publishing to social media outlets, this one does as well. Batch application integration (using Spring Batch, naturally) is explained. There are also some chapters I found of very high value: managing and monitoring, scheduling and concurrency, and Test Driven Development best practices.

This book is in Manning's "MEAP" program, which means it is available for early purchase, but is still being worked on. In this reader's opinion, the current MEAP version is of sufficient value to warrant a purchase. There's a lot of good material here, it's probably very close to a completed state.

So, what's the final verdict? I like the book for the clear explanations of how Spring Integration works. For users of other integration toolkits, there's also a lot of generic 'Systems Integration' knowledge that would be of value. If you're a Spring Integration user, buying this book should be a no-brainer-- it will quickly pay for itself many times over. If you're not a Spring Integration user, but are a user of another system integration toolkit-- you still might consider it, for the overall Integration value. All things considered, this book will be a good reference for the Integration user.

The book can be found here.

Sunday, July 17, 2011

ETL-- what is it, how it can be useful to you

What's ETL, and what can it do for me?

ETL is short for "Extract, Transform, Load", and it's a well established discipline of IT. ETL tools are usually fronted with graphical front-ends that facilitate putting together processes that work on streams of data. The data can be filtered, augmented, sliced into pieces, and put into new repositories. (That's E,T,E and L if you're a discriminating reader.)

So what can this do for you? In my day-to-day job, I used to work for a company that worked with gobs of demographic data, so we used ETL all the time. Mostly handling large files, splitting them into fields, validating values, adding values where none was there, and loading databases. But now that I'm doing something else, I still see plenty of uses for it. Got a log file you need to parse to look for trends? ETL can help. Do you have a list of Garbage Collection stats you'd like to work over? Another good use case. How about writing out some XML or JSON from a source in another form? Check, check and check. Would you like to automatically validate the format of some data, and send an email out if it needs some work? Another good case. Almost any time you have a reasonable amount of data and want to add to it, subtract it, split it into streams, validate it or place it somewhere else or in a different format, ETL should be one of the tools you consider.

ETL vs. ESB vs. Integration Framework

Is ETL better than an ESB (like Mule or JBoss ESB)? How about a lightweight integration framework (like Camel or SwitchYard)? ETL is often accompanied by a nifty user interface that lets you quickly drag-n-drop components onto a canvas, making for a very productive user model. ETL is almost always used to process large volumes of data, not single transactions. So while an ESB or an Integration Framework's usual use case might be onesy transactions, the ESB is going to go after a lot more than one record. (The records can come from a database, a flat file, an XML document, or other stores. The idea is that there is probably more than one of them.) This is not a concrete rule-- ESB and Integration Frameworks can process files, for instance, or an ETL tool can be made to operate on single records-- but it's almost always true. ETL is more about files (or groups of records) than it is about a single message.

Where can I get one of those?

ETL tools have been around a long time. Commercial versions exist that contain many nice features, but I really like an Open Source version called 'Kettle'. Like many successful Open Source products, Kettle is available in a commercial version and in the 'project' version that's freely available. I'd urge you to download Kettle and give it a shot if you haven't done so already.

OK, I got the free one. Now how do I get started?
The Kettle download comes with a 'Getting Started' guide that should have you running a sample flow in less than an hour. Better yet, you'll see all the cool drag-n-drop operations you can use and will soon be hacking together flows to munge data faster than you ever thought possible.

We interrupt this blog posting for a brief Book Review...

I've been inspired to write this blog post after reading a new book from Packt Publishing, "Pentaho Data Integration 4 Cookbook". Now that we have a baseline understanding of what kind of ETL we're talking about, let's talk a bit about this book.

The book does not teach Kettle basics. If you don't know how to start Kettle, you're going to have to read the user doc, because you won't find it here. What you will find is a sizable collection of best practices for accomplishing things with Kettle. (Many of the patterns will apply to other ETL products as well, though the implementation steps will be different.) Here are some of the things you might expect, and will find in this book:

- How to insert, update, and delete from a database
- How to alter a database at runtime
- How to read and write fixed flat files, CSV files, and Excel documents
- Reading and writing XML documents
- Shuffling files in the usual ways (copying, moving, remotely copying and moving), deleting
- Writing reports
- Sending emails

I'd expect any decent book on ETL to cover all those topics. These things are all basic uses of Kettle and would quickly be needed by many users. But wait! The book goes deeper, providing advanced use cases that will leave many advanced users puzzled. These include:

- Changing a database connection at runtime
- Parsing unstructured files (like a log4j log file)
- Validating XML against a schema or DTD
- Matching data based on 'fuzzy' matching algorithms
- Augmenting data with web services
- Splitting a flow into 'sub-Transformations' to facilitate management and re-use
- Effectively dealing with your data stream-- forking it into different streams for 'good' rows and 'bad' rows, and treating each differently

It's this second list of topics that really makes this book valuable. Honestly, Kettle is fairly intuitive to use, so a competent developer will probably figure out the basics without much assistance. The difference between a basic user and an expert will be the ability to figure out the more advanced use cases, and that's where this book provides a nice value-add.

The book can be found here.

I'm pretty excited about using a few of the tricks I've picked out of the book to help me with some recurring tasks. One of these tasks involves preparing data for R, the statistical package. (If you're not an 'R' user, please look back in this blog or elsewhere on the internet to see what all the hoopla is about. It really is nice!) Prior to this, I'd usually use Python and Bash scripts to massage and extract data from the sources I want to examine, but this actually can get to be a bit tedious. Using the drag-n-drop Kettle interface, though, I hope to apply my newfound knowledge to help me quickly stage data for advanced analysis. Wish me luck in this endeavor as I wish you good luck in finding uses for your problems as well. We're lucky-- never before have we had such a wealth of freely available tools to help us solve problems!

Happy Kettling!

Saturday, July 2, 2011

Book Review for "Oracle JRockit The Definitive Guide"

Have you ever worked with someone who knew a lot about the JVM? I did once, and it was an eye opening experience. Not only was this guy the right person to go to for performance and GC questions, he also was confident he'd written his programs for optimal performance. I was so impressed I decided this must be one of the characteristics of a superior programmer, and decided I'd try to improve myself in this regard.

I've just finished "Oracle JRocket The Definitive Guide" and I think this book has helped me on my journey to Java mastery. The early chapters are a little deep for an application programmer, but they still make for interesting reading. (Just how deep? How about discussions of the assembly code generated for your Java source? The very lowest levels of the JVM are discussed.)

After the lowest level workings of the JVM are covered, we encounter some material that's more likely to be of use to the average Java coder. We start learning about memory management, including in-depth coverage of garbage collection. (This is sure to be of use to any serious Java developer.) Java constructs of interest like Soft References, Phantom References, etc. are discussed. IMHO, these are topics that are beyond basic Java-- another tool in your Java toolkit!

There's a whole chapter on threading and synchronization. Once again, treading ground beyond that occupied by Java programmers at the basic level. Here you'll encounter topics like thin and fat locks, spin locks, and the innards of how threading is implemented on a JVM. If you're starting to get the feel this book is partly about computer science, not just programming, I'd think you may be right.

There's a lot of material related to understanding how the JVM is working. (This includes benchmarking, profiling, and understanding the running JVM.) It goes without saying this is all of high value to any Java programmer.

The final chapters of the book are devoted to the tools associated with JRockit. JRockit comes with a bunch of handy tools to help you monitor and control your JVM. These chapters show you all the slick GUI features and low-level switches you can use now that you understand what the JVM is up to.

Final impressions? This is an interesting book, because it's written hardest-materials-first. If you can hang with the early chapters you stand a lot to gain.

Who is this book good for? Any Java programmer will benefit from the early chapters. (They aren't specific to JRockit.) The latter chapters will be of use only to JRockit users, but since it's now freely available under a user friendly license, these tools are available to everyone.

It's a big book-- well over 500 pages, and none of it is fluff. I liked this book, it can be found here.

Happy 'Rockiting!

Saturday, June 11, 2011

Book Review for "Apache CXF Web Service Development"

Book Review for "Apache CXF Web Service Development" (When bottom-up "Hello World" is not enough)

Do you use Apache CXF? If so, you might take an interest in "Apache CXF Web Service Development". Here's my impression.

The book does a good job of covering CXF use cases, going beyond the usual trivial Jax-WS examples. It also covers Jax-RS (RESTful) web services, and covers each in enough detail that you're likely to find what you need when working with CXF.

Jax-WS has largely demystified basic web service development, so there's a great amount of content on the web that will show you how to quickly annotate a POJO to get a web service up and running. But what if you need to do contract-first (top down) development? Lightweight resources often conveniently bypass this more difficult trail, but this book does a good job of handling it. (This is no great accomplishment for a book on web service development, but it does set the tone for the types of things this book will show.)

Let's say you have a need to work with the raw XML, rather than getting the message in the form of a POJO? That's the use case for using a Jax-WS 'Provider' web service, and the book covers this and the client-side equivalent component (Dispatcher.)

How about if you want to change the message in some way, maybe altering security information? Interceptors are useful in that case, these are explained.

RESTful web services are pretty popular, they're in the book as well. Not only REST, but also how to implement then with XML payloads or JSON. You're given knowledge of the tools to test all these things, as well.

So who would I recommend this book to? I'd say a Java developer either currently using or wanting to use Apache CXF. The book isn't a complete reference for CXF, but it does introduce all the important topics. Once introduced, there's enough content to either solve your problem or at least educate you enough to effectively research what remains.

The book can be found here.

Happy Jax-*'ing!


Friday, May 27, 2011

Book Review for "Apache Wicket Cookbook"

Have you heard of Apache Wicket? It's a web framework that tries hard to eliminate all the XML configuration you see in most modern application frameworks. The developer produces two primary flavors of artifacts-- Java classes and HTML pages, and with these two your application is built. If this sounds interesting, you probably don't need to see this new book from Packt.

You may be wondering why I wrote that you don't need to see the "Apache Wicket Cookbook" if you found the description of Wicket interesting. The reason I wrote that is because this book is going to be of very little value to someone who's just found out about Wicket. But if the reader already knows the basics-- then this book is a powerful resource.

There's very little introductory material. The book is honest about this in stating the target audience-- it says if you've already written a couple of Wicket applications, then you're a good candidate to pick this one up. I agree. If you don't know the basics of Wicket, a lot of this will be over your head.

Still reading? Then you might be familiar with writing Wicket applications already, and might wonder what you'll find in this book. I'd summarize it by saying there's plenty of material for someone charged with writing real-world applications in Wicket. A few examples: Securing your application, editing pairs of fields based on values in each, displaying data in the form of charts and tables that are sorted when you click a header. Still want more? How about integration with Spring, Seam, and JPA? The book reads like a bunch of answers to support questions, provided by someone who really knows Wicket but doesn't have time to explain all the theory behind the answers. There's just a flat out explanation of what to do, backed by code examples that quickly import into Eclipse and run flawlessly. If you want to understand *why* what you're doing works, it's going to be up to you to follow up with Wicket reference material to see why. High level overviews are not in the very direct path this book takes.

The book is written by Igor Vaynberg, who is probably the most prolific contributor to Wicket, so you know the author knows his stuff. The use cases are supposed to be issues that real-world users will need to conquer, and again Igor is a good source for these. (He is well regarded in the Wicket community. I encourage you to consult your friend Google to check this out.) Igor knows what people are wanting to do, and he knows how to do it. This book is a collection of that kind of information.

The book is written in Packt's "Cookbook" format, which is exactly what this book needed. It presents a problem, tells you the steps to find the answer, then briefly (very briefly) explains how it works. In-depth research is up to you.

Final verdict: If you're an active Wicket user, you should buy a copy of this book. It'll pay for itself the first time you need to solve one of the roughly 50 scenarios it covers. You'll have the right answer, the first time, and a running example to help you understand it. If your sense of curiosity demands that you understand all the details of how those parts work-- that's extra credit research for you, dear reader. But your site will have the functionality you seek in short order.

The book can be found here.

Happy Wicketing!


Sunday, May 15, 2011

Book Review for "Camel in Action"

Book review for 'Camel in Action'

The Manning 'In Action' books are usually good ones-- readable, thorough, and suitable for use as both an introduction and a reference. This book is no exception.

The topic is Camel, Apache's open source framework for implementing Enterprise Integration Patterns. If you're wondering what that means, you might consider Camel an 'ESB Lite'. It's not a true ESB, I think mostly because it doesn't have it's own hosting runtime, but beyond that it does many of the things an ESB does.

Camel can be used to route messages. So let's say you want to listen on a JMS queue and use the results to call a web service. No problem for Camel, the book tells you how. Likewise, if you want to do some message transformation-- maybe read in a file, split it into lines, enhance each line with some stuff you get from a database-- no problem. The book does a great job of demonstration through simple examples, which I found to run well and easily. Warning: if you're not a Maven user yet (I think Maven is beginning to definitively prevail in the Ant/Maven battle), you'll want to brush up a little as it's used exclusively throughout the example suite.

The book is exhaustive in it's coverage of Camel-related topics. Sometimes tech books are written in such a way that development-centric topics are given great coverage, while operational issues are not. This is not the case here-- it's obvious the authors of this book have spent some time deploying, running, and monitoring applications as well as writing them.

The source code that comes with the book is well organized, clean, and relevant for the chapter material it augments. Most important, it runs out of the box.

Camel basics (routes, Java and Spring configuration, the Enterprise Integration patterns) are all covered in more-than-adequate fashion. These are basic but necessary topics any good Camel source should provide. Where this book excels is in the ancillary material: management, monitoring, threading, transactions, testing, deployment in popular containers, etc. Very thorough, it's why this book is 550 text-packed pages long.

If I had one complaint about the book, it would be that the chapter ordering wasn't quite to my liking. The reader is given plenty of example material (including some advanced topics like transactions and concurrency) long before the basics of setting up a user-concocted "Hello World" project are presented. This is a minor nit, though, and it does not detract from the overall excellence of the book.

Bottom line: this is a must-have resource for any user of Apache Camel. It can take you from ground-level to production use, and will no doubt serve as a valuable resource for as long as you use Camel.

The book can be found here.

Happy Camel'ing!

Thursday, May 5, 2011

Book Review for 'BackTrack 4: Assuring Security by Penetration Testing".

Book Review for 'BackTrack 4: Assuring Security by Penetration Testing". White hats, get a copy now before the bad guys snap them all up.

I've just finished reading Packt Publishing's new book "BackTrack 4: Assuring Security by Penetration Testing". The book is meant to be a how-to guide for using BackTrack 4, a freely available Linux distribution whose sole purpose is to provide a platform for a hacker's arsenal. I'd never looked at Backtrack before, but believe me, it's a site to behold.

The distribution, once downloaded, can be installed on a machine or run as a 'live' DVD. (The book covers all this, naturally.) Once booted, the user has a *whole operating system* loaded to the gills with tools meant for breaking into computer networks and vulnerable hosts. It is frightening in it's scope.

The book is written for good guys, of course, so it includes a good amount of text that's of use to security professionals. It covers how you should make your agreements with the system owners you are assessing, the kinds of reports you should prepare, and a very useful framework for disciplined testing. The framework breaks penetration testing into discrete phases.

The first 'hacking' phase is Information Gathering. Here the user is introduced to about a dozen tools that can be used to find domain names, IP addresses, host names, and other information about the target environment.

The next phase is Target Discovery. Here the user finds hosts and identifies operating systems. Again, about a dozen different tools are presented.

The next phase is Target Enumeration. This phase allows the user to discover which ports are available, which services are offered, and what kinds of VPN are in use.

Once all this information is gathered, the user can proceed to Vulnerability Mapping. Here, another good sized set of applications are available to help the user determine what kinds of vulnerabilities exist in the target machines. This logically leads into the chapters on Target Exploitation, Privilege Escalation, and Maintaining Access.

Of course, no good book on penetration technique would be complete without a chapter on Social Engineering, and so we have one here.

So what did I think of the book? At first glance, honestly, I was unimpressed. Just picking up the book and thumbing through it revealed a great number of very brief introductions to tools. You'd see many pages where a tool is introduced, then given just a page or two of instructions on how to invoke it and what output to expect from it. It was only after I started actually reading the book that I realized the tools were neatly categorized (as explained above) and that the brevity of the introduction was soley because the authors already filled 350 pages and probably simply couldn't practically include more detail.

I've never intentionally hacked another system, but I have at times used tools like WireShark to observe network traffic as I sought to untangle some security problem or communications glitch. This book has provided me with several ideas for similarly useful tools, and introduced me to several I have no intention of ever using. (Unless I should decide to one day become a security consultant, and offer to hack into systems for profit. In that case, I'll make myself familiar with all the tools in the BackTrack toolkit.)

If your livelihood depends on a secure site, you probably ought to get a copy of this book for your in-house penetration tester. It's an eye-opener.

The book can be found here.

Happy (ethical) Hacking!

Saturday, April 23, 2011

Tools to learn somebody else's codebase

Writing code can be a difficult task, but reading it is usually even more challenging. Here's a quick tip to help you the next time you want to make sense of a bunch of code you don't yet know.

My day job is working support for JBoss. If you haven't noticed, JBoss doesn't let much moss collect-- projects are constantly moving, improving and springing up from the ground. If you want to keep up in this environment, you'd better learn to read code and digest it quickly-- and that's the need that produced this solution.

One of the things I like to do is add a quick function to my .profile (we'll see how to use this in a bit):

# Use this with 'tree'. Works with wildcards
getF() { THF=`find . -name $1`;export THF; /usr/bin/gedit $THF & }

I'd use this in conjunction with Linux's excellent 'tree' command. Use 'tree' to quickly see what the source base looks like, then use getF() to easily zero in on files that are of interest.

Let's go with an example. Today I'm looking at the just-released droolsjbpm-integration package (which looks good, and runs some neat examples out of the box, by the way.) So I might start like this:

rick:~/Tools/droolsjbpm-integration-distribution-5.2.0.M2/examples$ tree
|-- binaries
| `-- droolsjbpm-integration-examples-5.2.0.M2.jar
|-- runExamples.bat
`-- sources
|-- pom.xml
`-- src
|-- main
| |-- java
| | `-- org
| | `-- drools
| | `-- examples
| | |-- broker
| | | |--
| | | |--
| | | |--
| | | |-- events
| | | | |--
| | | | |--
| | | | |--
| | | | |--
| | | | |--
| | | | |--
| | | | `--
| | | |-- misc
| | | | `--
| | | |-- model
| | | | |--
| | | | |--
| | | | |--

(More deleted. You get the picture, though. Get the picture.... get it? Hee hee.)

So we immediately get a view of what's in the codebase. You might see how much code is out there.....

rick:~/Tools/droolsjbpm-integration-distribution-5.2.0.M2/examples$ find sources -name *.java | wc -l

So only 46 java artifacts. Pretty reasonable.

If a codebase has a lot of interfaces and inheritence, it can be a little tougher to read. So we might have a look at how much of that is out there....

rick:~/Tools/droolsjbpm-integration-distribution-5.2.0.M2/examples$ find sources -name *.java |xargs egrep 'implements|extends' |wc -l

Hmmm, that seems a little rich, for only 46 java files. It could be that you're working with a framework built to allow lots of things like plug-ins and alternative implementation (in a good case) or it could be that you're reviewing code written by someone who reads too many academic textbooks and doesn't really grasp the proper use of such abstractions. In this case, I'm confident it's the first case.

OK, so now let's see how that function we put in .profile can be put to use:

rick:~/Tools/droolsjbpm-integration-distribution-5.2.0.M2/examples$ getF Cell*
[3] 2514

Immediately, my text editor pops up showing me,,,, and

I grant you, much of this is also available via a nice IDE like JBDS or Eclipse, but sometimes (well, frequently, really) it's hard to wrangle the projects into an IDE without doing a bunch of classpath setup, dependency downloads, etc.

Happy Code Reading!

Saturday, April 16, 2011

Book Review for "R Graphs Cookbook"

Quick! What do James Gosling, Bill Gates, Linus, Bjarne, Larry Ellison, Uncle Bob, Martin Fowler, and Gavin King all have in common?

These are all graphs I produced with the book's samples.

They all know how to produce compelling presentations. While some of the above are good programmers (even excellent ones), we don't know of them because of that. We know of them because they influence our thinking. Every programmer who advances through the ranks eventually gets to the point where they need to influence people as well as sling code. (It's all about scalability. One person can only do so much-- but if that one person can effectively influence a group of others-- then the reach of that coder is greatly expanded.) So too it should be with you-- you need to learn how to produce artifacts that will influence people and bolster your arguments.

To that end, I am really pleased with "R Graphs Cookbook" by Packt. If you haven't used R yet-- regardless of whether you read this book or not-- you need to download this excellent open source statistical package and get yourself acquainted. Search this blog for examples, I've posted a few. R makes statistics easy, and statistics can lend assistance to everything from log analysis to garbage collection optimization. This book is about R's excellent graphical capabilities, though.

This book doesn't teach R, and it's target audience is an experienced R programmer. I really think even an R novice could use this book to produce impressive graphs, though-- each recipe is very short and shows what's needed to produce the graph you're after. By the way, I think one of the best parts of this book is the available source code-- you don't even have to type in the examples, and the sample data is invaluable. By the way, studying the way the data is structured is highly educational. I'd strongly recommend examining the data with each recipe to maximize your learning.

The book teaches you how to draw all kinds of graphs: scatter plots, line plots, pie graphs, bar charts, histograms, box and whisker plots, heat maps, contour maps and regular maps. The 'regular maps' covers maps of the world, a country, a state, etc.

If I had a wish to improve this book, I'd wish for a comprehensive index that covers every page where a specific function or argument was used. Sometimes functions are demonstrated in one graph recipe that could be useful in making a different kind of graph-- but if you don't know where to look for the example, it could be difficult to find. It's an omission I can live with, though.

This book will get a spot on my reference shelf. For those occasions where I need to produce the proverbial picture worth a thousand words, I know where I'll reach.

The book can be found here.

Happy Graphing!

Thursday, April 7, 2011

Visualizing a Log's Timeline (without going blind reading text)

How to Visualize a Log Timeline

Have you ever tried to read a massive log file? It can be difficult. Logs from multithreaded servers (or worse, clusters) can be miserable to work with. Sometimes a little visualization can help.

Log reading in small single threaded applications is easy. You just read through the log until you see the ERROR, then back up from there to see what went wrong. But what if your server is multithreaded? Then it gets a little more difficult. Or if you're dealing with distributed components like messaging servers and users of those servers. Things can also be ugly there.

Sometimes it's just fun to visualize data, looking for patterns. So how can you do this easily? I like to use R.

Let's take an example. Say you're working with JBoss AS 7, and your log looks something like this:

2011-03-20 21:22:38,854 DEBUG [org.jboss.logging.Log4jService] Installed System.out adapter
2011-03-20 21:22:38,855 DEBUG [org.jboss.logging.Log4jService] Installed System.err adapter
2011-03-20 21:22:38,859 DEBUG [org.jboss.logging.Log4jService] Added ThrowableListener: org.jboss.logging.Log4jService$ThrowableListenerLoggingAdapter@1815338

Pretty dry, right? Working with this log, I'd probably go about visualizing it by computing 2 fields and extracting one for convenience:

  • A timestamp field, formatted so it's easily sortable. You probably could do this in R, or even with shell script utilities, but I took the easy road for this one and used python to work my log for me.

  • A numeric value that maps to the log severity. 0 for 'TRACE', 1 for 'DEBUG', and so on for INFO, WARN and ERROR.

  • For readability, I also extracted the text value of the log level. Shame on me for carrying duplicate data, but it makes the extract file more convient to read.

So the first 4 lines of my extract file look like this:

TimeStamp LogCode LogLevel
76958854 2 DEBUG
76958855 2 DEBUG
76958859 2 DEBUG

The header line is necessary for the R script. I'm sure you would've figured this out, but the first field was calculated by taking the 'hours' value (21 in the first line above) and multiplying it by 60 * 60 * 1000. That was added to the 'minutes' value (22 above) by 60 * 1000. That was added to 38 * 1000, and that was added to 854. As I said above, python works great for that. If you're able to do that quickly in a bash script, my hat's off to you.

But I digress. So we've got our extract file, now to visualize it. Just run it past an R script that reads something like this:

logData <- read.table("my3FiledExtractFile.txt", header=TRUE)
summary (logData)
png("Graph.png", res=200, height=1200, width=1200)
plot (jitter(logData$TimeStamp), logData$LogLevel,
ylab="Log Level", yaxt='n')
axis(2, c(1, 2, 3, 4, 5))

First, the summary() output will provide you with some interesting statistics:

summary (logData)
TimeStamp LogCode LogLevel
Min. :76958854 Min. :2.000 DEBUG:31126
1st Qu.:76997498 1st Qu.:2.000 ERROR: 61
Median :77043075 Median :2.000 INFO : 647
Mean :77096907 Mean :2.027 WARN : 7
3rd Qu.:77236122 3rd Qu.:2.000
Max. :77320903 Max. :5.000

So in an instant we can see what's in this log we're dealing with. But that's not the visualization we're looking for, that's what we see below.

Isn't that cool? We can see we start out with a bunch of DEBUG messages (the heavy line at the bottom), then get our first WARN (the lonely first dot on level 3) , a bunch of more DEBUGs, a bunch of WARNs and then our first ERROR. The timeline reads from left to right, the error levels progress upward for the various levels.

I think data visualization is cool, and I intend to learn more about it to help me draw information from raw data sources. To that end, I've been working with Packt's "R Graphs Cookbook", and will provide a book review here soon.

Happy Visualizing!

Friday, March 18, 2011

Book Review for Android User Interface Development: Beginner's Guide

Book review for "Android User Interface Development: Beginner's Guide"

This book teaches Android UI development in Packt's 'Cookbook' style. The book is written in a very understandable way, yet still teaches good UI design in reasonable depth. It covers technical aspects of UI development (use of widgets, themes, animation, styling) as well as development practices (how to validate input).

If you haven't seen a Packt Cookbook yet, it's a book primarily broken into recurring sections with titles "Time for Action", "What Just Happened" and "Have a Go, Hero". "Time for Action" is a series of instructions that spell out exactly what to do for a sample scenario. "What Just Happened" follows up with an explanation of why the reader was asked to execute the instructions. "Have a Go, Hero" is a section challenging the reader to extend the spoon-fed instructions by implementing a next-step challenge. This style of writing emphasizes hands-on knowledge transfer without a lot of verbose theory, so it'll be good for readers who like to learn as they code.

Be aware this is not a book on Android development in the general sense. There is some introductory material here: installation and configuration of the SDK, a first rudimentary project, a little other ground-level material. But largely this book concentrates on UI aspects. To put that in context, if this were a book in the Enterprise Java workspace, it'd be entirely about JSF and have not much on EJBs or JMS. (I'm not sure if that's a good parallel, but I'm sure you get the idea.)

The sample code is well laid out and is structured in the same way the SDK examples are structured. (So if you're learning the basics of Android development by following the SDK doc, you'll be good with the book samples.) The topics chosen for inclusion in the book are a good representation of the kinds of UI issues an Android developer is likely to encounter. So what exactly can you expect to learn from this book? Here's an incomplete list, but one that shows the kinds of things that are covered:

- How to present a question to the user
- How to receive an answer
- How to handle list choices (multi-select? single?)
- Headers and Footers
- Making a photo gallery
- Handling Date/Time
- Layouts (Swing users will find this familiar)
- Validating inputs
- Animation
- Styling (i.e. changing a button's appearance)
- Application themes

If this list makes you think the book teaches a mix of programming skills and graphic design, I wouldn't say that you're wrong. (I've always been a programmer type, and never much of a polished UI presenter, so I learned some new things in the styling and theme categories.)

Who would benefit from reading this book? Android developers who want to write a professional looking application. If you're like me, your first instinct is probably going to be to just run out and read the SDK doc to hack together some sort of functional application. But if we want people other than ourselves to like it, then we'd better be sure it looks, feels, and acts like the user expects. That's the place where the book brings value-- teaching us how to make our Android apps pretty.

The book can be found here.

Happy (mobile) coding!

Wednesday, February 16, 2011

Win a year's worth of Packt e-Library

Just a quick note tonight to pass along some news from my friends at Packt.

This month is IBM month at Packt-- books are offered at a discount, and every Tuesday they offer a chance to win a year of PacktLib. Wouldn't that be great!

If you're using IBM products, give it a look!

IBM Tuesday can be found here.

The Tuesday competition can be found here.

Happy Reading, and Good Luck!

Saturday, February 12, 2011

Book Review for 'jBPM Developer Guide'

jBPM is a mature and popular process management framework. This book can help you get beyond the basics so you can write useful real-world applications.

jBPM is a well established process management framework. BPM (Business Process Management) is a software discipline that allows a developer to build applications as a series of steps. Under ideal circumstances, designers drag and drop pictures onto a graph that later become a business process definition. The process centers around some business activity. For instance, an 'Expense Report' process might involve the steps: Gather expense information, Management Review, Approval/Denial branch and Produce check. Here's a sample picture to let you know what such a graph might look like:

jBPM is referenced in quite a few SOA books, and with good reason. It's a really good framework, and it's been in use for a lot of years, so it's feature rich and stable. jBPM can be used in a lightweight manner if your situation allows it (that is, just by including the right .jars, you can skip the designer part and in-line some XML in your application code. That's probably the lightest configuration, and the one many SOA books describe.) But what if you need to do some stuff not covered, like involve humans in the process?

Human interaction is a little trickier. With only automated activities, your BPM process can be handled something like b-flat BPEL. You can just describe the series of tasks (java classes and methods) you want to be invoked, and the framework executes them, bang, bang, bang. But what if you want someone to look at a web page and provide you some feedback? Now you're in the territory this book is covering. It goes beyond the basic usages, and tells you what you're really going to have to know.

You'd better be ready to download and read the book's source code, because without it you really won't get as much out of the book. The author includes and explains the relevant text in-line in the book, but you really need to view and understand all the pieces of the project to learn to piece together workable applications.

The book is true to it's title in that it is definately a developer's guide. The reader is coached through building their own Java-powered state machine in the early chapters, sort of a mini-jBPM. This is a good exercise, as it gives insight into how jBPM functions. Shortly after, the author introduces the development environment, which includes Maven and Eclipse.

The middle chapters deal with jPDL, which is the XML language that powers jBPM. The language is not complicated and the book does a good job of explaining it.

The final chapters work through case studies and explain persistence and enterprise features. Persistence is important because you'll want your business processes to maintain integrity through server recycles. Naturally, jBPM makes use of other parts of the JBoss stack like Hibernate, data sources, etc. so these are covered in sufficient detail for jBPM use.

So, what's my overall opinion of this book? I'd say it's a good resource, and would recommend it to anyone who's going to write a jBPM application beyond an example "Hello World". The book isn't perfect-- it's not written in an easy to read manner. (I suppose that's acceptable, given this is a book for developers.) This book was written near the end of life for jBPM, which will be JBoss's final supported version for a while yet as the next supported version will be based on the brand-new jBPM 5. (Which is quite a change from jBPM 3, by the way.) If you are going to use jBPM 3 (and there are a lot of good reasons why you should), this book is worth the price.

The book can be found here.

Happy Reading!

Saturday, January 15, 2011

Book Review for "OSGi and Apache Felix 3.0 Beginners Guide"

Book review for "OSGi and Apache Felix 3.0: Beginner's Guide"

This book promises to bring a developer from level zero through advanced usage of Apache Felix, a pretty ambitious goal. Before we get into how well it delivers, let's talk a little about what OSGi and Felix are.

OSGi is a specification meant to save Java developers deployment and classpath headaches. If you've ever used Eclipse, you have used OSGi, albeit as a user. OSGi is bigger than just Eclipse, though-- it's the basis for a whole new class of frameworks, and it's got buy-in from the guys at JBoss, Spring, Apache and others.

OSGi is meant to alleviate classloader headaches. It helps keep your deployments clean, allowing you to run application that have dependencies on libraries that might differ in version from what other deployments need. In other words, you can specify exactly which libs you need, and which versions, and OSGi will manage keeping all the applications happy.

This book teaches Apache Felix, which is a pretty mature OSGi implementation. The cruxt of the book is building, then improving a simple bookshelf application. Maven2 is used for the build duties, and the author is very generous with providing instruction about how to build your .pom files each step along the way.

Felix (and OSGi are much more than just a runtime container, though. Felix contains lifecycle startup mechanisms, so these are taught. You're also given a whole chapter on the shell language Felix provides for control functions.

Beyond that, it's mostly application development done the Felix way. Even tasks as mundane as logging are different under OSGi, and this book gives insights into all the nooks and crannies you'll need to implement the bookshelf application. (Note: I'm sure EVERY nook and cranny isn't explored, but if you follow the clear instructions this book provides you'll end up with a running application.) The book leads you through an incremental buildup of the app, so you'll add functionality bit by bit as you improve the application.

The book ends with a nice-to-have chapter on troubleshooting and a few quick write-ups on the dev environment (Maven and Eclipse) and other topics that should be within reach for the reader.

So, what's the verdict? OSGi coding is not trivial, and isn't something to be taken up lightly. (It's yet another Java framework to be embraced, complete with it's own set of twists and turns.) If you're going to learn it, though, this book is a very good from-the-ground-up resource to guide you completely through the learning process. So if you're going the OSGi path, this is a good place to start.

The book can be found here.

Happy Reading!

Friday, January 7, 2011

Packt begins publishing Microsoft books

Hi all,

I like to review technical books, and I have reviewed plenty of them from Packt Publishing. Packt has always been a good provider of material on Open Source topics, but has recently branched out and is now offering Microsoft titles as well. Enclosed is a brief press release from the folks at Packt, for the benefit of MSFT readers.

Happy reading, and good luck in the Monday drawings!



On Monday the 24th January, 2011 Packt Publishing is issuing five brand new Microsoft Books on a range of different subject matters:

  • Microsoft SQL Server 2008 High Availability

  • Microsoft Application Virtualization 4.5

  • Microsoft Forefront UAG 2010 Administrator's Handbook

  • Dynamics AX 2009 Administration

  • Microsoft Dynamics Sure Step 2010

  • (Microsoft SharePoint 2010 Administration Cookbook)

With five Microsoft books published at the end of 2010, the publication of a further five new books all on one day reiterates Packt’s commitment to producing specialist Microsoft book titles, and signifies their position as a top Microsoft publisher. James Lumsden, the Packt Enterprise Publisher states that “serving the needs of Microsoft professionals is one of our top priorities at Packt, and 2011 promises to be a bumper year. What better way to kick off the New Year than with five exciting new titles on Microsoft Monday! As always we want to do our utmost to serve you, the reader, so please email us if you have book ideas, general suggestions, or if you just want to offer some feedback. Have a great 2011”.

To mark this milestone Packt is also offering a 25% discount when you purchase two or more Microsoft books throughout January. And will be running a competition throughout January offering customers the opportunity to win a free 1 year’s subscription to PacktLib every Monday throughout January.

For further information on this, and other books published by Packt Publishing, please visit this link.