Sunday, January 31, 2010

Book Review - JBoss AS 5 Development



This book found here.

Book Review for "JBoss AS 5 Development" by Packt Publishing

This review is for "JBoss AS 5 Development", which has the subtitle "Develop, deploy, and secure Java applications on this robust open source application server". Having gone through the book with IDE in hand, I would have to say I find the subtitle more indicative of the content than the first part of the title. Later I'll try to explain why I feel so.

The book promises to cover a great amount of territory. Roughly, the 14 chapters cover these topics:
- Installation of the application server and Eclipse-based IDE toolkit
- Major differences between JBoss AS 5 and previous versions
- Customizing your JBoss installation
- Developing EJB 3 Session beans
- Working with JPA
- Writing a web application (JSF)
- The new JBoss messaging subsystem (JMS)
- Writing Hibernate applications on JBoss
- JMX and MBeans
- JBoss Web Services
- Clustering JBoss servers
- Writing Clustered Applications
- JBoss AS Security
- Securing applications under JBoss

If that seems like quite a list to digest, I would agree. The last 4 chapters give a hint to the depth of content the reader will encounter. In those cases, the author first presents an overview chapter about how the application server handles the topic (clustering, security), then follows it up with a whole chapter about applying the implementation details. I thought this struck the right balance between being too high-level (as many books might be) versus being overly detailed (as the old JBoss 4 AS doc book could be in places.)

I think this book will be an excellent acquisition for anyone who is certain they will be working with JBoss AS 5. The author has a deep understanding of the application server and writes in an easy to understand style. The book covers a great amount of 'real world' territory that is sure to be of interest for anyone tasked with moving an application to production under JBoss AS 5. Subjects like security and clustering (must-haves in a production environment) are given enough coverage that they can be of immediate practical use. (Note: these topics are not of vital importance in a pure development effort. A great amount of development can be done without paying attention to either security or clustering.) This is one reason I consider this book to be an interesting blend of development material and administrative material-- it is clearly not a pure development book.

For those that are interested in learning JEE but are not certain they'll be using JBoss, I'd suggest they should consider this book but also compare it to other titles, perhaps one of Packt's excellent NetBeans/GlassFish titles. This is not the fault of the book-- the author does a good job of walking the reader through various exercises in building EJBs, a JSF front-end application, a web service application, etc. The reason I don't suggest this book for new students of JEE is that the raw toolkit is just not at the same level some other open source development stacks are at. (Notably, NetBeans 6.8 and GlassFish). Putting it plainly, there are more than a few things that can go wrong in putting together a JEE application with JBoss Tools-- if the user isn't seasoned in problem analysis and debugging, it could easily lead to frustrations and an unsatisfactory experience.

If you're already confident in your ability to write and deploy JEE apps, you should find this book to your liking. Intermediate to advanced JEE developers ought to find plenty of material to keep them interested. Performance tips, JBoss specific extensions, and expert usage tips for enterprise Java development all get good coverage. The author knows the ins and outs of using JBoss AS 5, and is generous in providing tips in effective usage of facets the reader is likely to encounter. The author also provides good high-level overview material (which usually precedes the detail), which helps keep the reader grounded in the larger context of what's being conveyed.

The book provides a reasonable number of illustrations, including screen shots of JBoss Tools wizard screens. I found these of reasonable value, but have to admit I'm of mixed emotions on the toolset itself. It does a great job of some things (I love the packaging wizard that let's you declaratively roll up .jars, .ears, etc.). On the negative side, it makes some actions much more difficult than they have to be. I thought the author did a good job of providing meaningful illustrations where an abstract idea was being presented, especially in the security and clustering chapters. I once made a presentation at JBoss World about studying for the Sun Certified Enterprise Architect exam using JBoss-- I wish I'd had those illustrations then! I guess my SCEA is now a depreciated asset-- maybe we'll have to study for 'Oracle' architectural credentials in the future.

All things considered, this book will be an excellent source of information and reference for anyone using JBoss AS 5. I'm sure it will prove value time and again as the reader delves into the various corners of enterprise Java. This book offers expert insites on many topics and does it in an easy to read manner.

Happy Coding!

Wednesday, January 27, 2010

Birth of a NetBeans fan-boy

As I mentioned at last post, I've been reviewing the Enterprise Java development stack. I've just finished writing some basic JPA applications using two different Application Servers (JBoss, GlassFish) and toolsets (JBoss Tools, NetBeans). I really like Eclipse and JBoss, but I really have to hand it to the NetBeans folks on this one. Here's what I found to like:

- NetBeans will generate your Entity Beans for you, based on your schema (JBoss Tools does this, too)
- NetBeans will generate Session Beans based on those Entity Beans
- NetBeans will even generate a JSF CRUD application for you, exposing those Entity Beans!
- NetBeans will generate your Persistence Unit for you
- NetBeans will generate your DataSource for you (I think JBoss makes you copy a template file by hand for that one)

All these things alone aren't so stunning, but what's really cool is the cohesive feeling the IDE gives you. All that, plus integrated App Server control, Database control, etc. (In fairness, JBoss Tools offers a lot of these, too.)

Now, for the grand whammy: I am ecstatic about the NetBeans Hadoop plugin from Karmasphere, which I first saw here. That plug-in just flat out rocks! Using that plug-in, I ran my first Windows Hadoop job this afternoon about 20 minutes after I first saw the article. Tonight, I ran a second job on my Ubuntu laptop (which runs an honest Hadoop installation as well) in about 2 minutes, without looking back at the instructions. Everybody needs to look at this plug-in, it's flat out cool and makes Hadoop development an easy, desktop proposition.

So here I sit, a several-year Eclipse user absolutely stunned by NetBeans 6.8. I can only hope Oracle lets this IDE continue, it is definately raising the bar.

So go get yourself a download of NetBeans 6.8, and Happy Coding!

Rick

Thursday, January 21, 2010

A few things I like (and don't like) about EJB3

What I like (and don't like) about EJB3 and recent IDEs

It's been a long time since I worked with JEE, so I've recently been working with late-model application servers from Sun and Jboss. (I wanted to work with both at the same time to see which toolset I really liked best, and to help me better understand things.) This week I've been working with EJBs and I'm delighted to report EJB3 really does fulfill the promise of greatly simplified development. After a few hour's practice, I am now confident I could crank out a Session bean from scratch in less then 5 minutes on either JBoss or NetBeans. (In the old days, this never would have been possible.)

Here are a few of the things I liked and disliked about my re-acquittance with EJBs.


What I like:
1. Plain annotated POJOs in a .jar -- no XML, and it really does work.
2. NetBean's 'Insert Code'/'Call Enterprise Bean' wizard. Client code made simple!
3. The excellent online tutorial here
4. Using JBoss Tools, I really like the 'Archive Manager' view. It gives you a great UI to make a .jar, .war, .ear, whatever you need. With no scripting!
5. The JBoss Tools 'Server' view. Easy, in-Eclipse way to start/stop the Application Server
6. Ditto for NetBeans and the GlassFish controls. (Extra credit to NetBeans for Database control in the IDE, too.)

What I didn't like:
1. NetBeans generating a bunch of stuff behind my back. (Of course you can use jar -tvf to see what it is, but I'd rather see it up front where I can easily understand it.)
2. JBoss and the never-ending story of how you really write EJB3 beans. They now have a bi-monthly plug-in you have to apply to keep your app server up to date! If you Google for a JBoss EJB3 tutorial, guess what you'll find? 17,000 blogs that tell you the way that guy did it, most of which won't work for you. (At least that was my experience.)
3. Writing a JBoss client that needs a properties file or in-line setting of necessary properties. In the old days that was fine, but NetBeans has raised the bar on that one. (Counterpoint: I guess I have to use the default ports, etc. for the NetBeans auto-magic client to work. Fine with me, for today at least. BTW, I recognize this is inconsistent with Gripe #1.)

If you've never written an EJB, or haven't written one lately, I'd really encourage you to have a look. (If you're really new to it, I'd suggest the NetBeans/GlassFish route, I think it's a little easier.) If this is the future direction of Enterprise Java, I am encouraged.

Next up: JPA persistence. Let's see how that one goes!

'Till then, Happy Coding!

Saturday, January 16, 2010

Keeping Current with JEE-- the App Dev showdown, round 1

JEE Development -- contemporary toolkits, Round 1

As mentioned earlier, I'm on a quest to refresh my Java EE skills. I've decided to explore two popular toolkits-- Netbeans/GlassFish and JBoss Tools/JBoss AS 5.1. This entry is the first of a short series documenting my findings.

Resource guides
To help me navigate the JEE waters, I'm using 3 titles from Packt publishing:

Java EE 5 Development using GlassFish Application Server
GlassFish Administration
JBoss AS5 Development

By the way, if you follow the above links you'll find free chapters and other resources.

Initial impressions:

Setup
GlassFish comes optionally packaged with NetBeans, in a very convenient single download. Everything was easy to use and worked out of the box.
JBoss Tools and JBoss are not integrated. JBoss Tools is a set of Eclipse plug-ins which you have to download into your Eclipse instance. On my Ubuntu laptop, both the app server and the Tools plug-ins downloaded and configured as advertised.
Advantage: Netbeans/GlassFish (hereafter 'Sun') for the tight integration.

App Server Configuration
I started out with some knowledge of old-school app server configuration, but it's been at least 2 years since I worked in this space. For that reason, I relied pretty heavily on my books for this section.
GlassFish offers both a well-put together UI and a command-line interface for most every configuration task. The UI is top-notch and intuitive to use.
JBoss offers 3 different UI consoles (Administrative Console, JMX Console, JBoss Web Console) and a wide array of XML-based files that can be used to perform most common administrative tasks.
Advantage: Sun, for ease of use. In the long pull, JBoss may offer a little more granularity in configuration, but unless you spend a lot of time learning the nooks and crannies, you're going to be up to speed much faster with the Sun toolkit.

So we end today's blog with the score 2-0, favoring the Sun JEE stack. Let's see if this holds true as we enter the application development arena in a near-future blog.

'Till then, Happy Coding!

Wednesday, January 6, 2010

GlassFish vs. JBoss -- current best dev kit?


As I previously posted, lately I've been working with the Netbeans/GlassFish combination in an effort to keep my Enterprise Java skills current. I've been very pleased with the ease of application development and have to say that JEE has never been easier.

I have a concern, though. The shop I work at is a JBoss shop, which makes me wonder about the current state of the development world for JBoss developers.

I've worked with JBoss for a number of years, but never did find it especially easy to keep current on toolkit usage, especially compared to the aforementioned Sun toolkit. I really like the latest NetBeans all-in-0ne toolkit that runs the databases, App server, dev tools, etc. all within the IDE. To counter that, the last time I checked JBoss had a free offering that was comprised of a set of Eclipse plug-ins that offered similar functionality. It's been a while since I used that kit, but I don't remember it being nearly as slick as this latest NetBeans offering. Maybe it's time I have a fresh look at what the JBoss folks have in store for us.

I know I'm going to get results fastest if I seek expert counsel, so I'm going to refer to "JBoss AS 5 Development" from Packt Publishing. The book promises to cover plenty of ground, going from app server install, through the development process, security, and deployment all the way through app server clustering.

I've already had a read through the FREE sample chapter, which can be found here. The sample chapter covers use of Hibernate and Hibernate tools under JBoss, written in a very easy to understand step-by-step manner. In my next code practice session I'll get JBoss installed and try to establish my own basic Hibernate web app, based on the contents of this chapter.

I'll blog more about my luck with the JBoss kit after I've had a chance to read the book and write a few sample applications. Here's hoping we find good things there!

'Till then, Happy Coding!

Rick