Expert One-on-One J2EE Design and Development

Rod Johnson

Mentioned 3

What is this book about? The results of using J2EE in practice are often disappointing: applications are often slow, unduly complex, and take too long to develop. Rod Johnson believes that the problem lies not in J2EE itself, but in that it is often used badly. Many J2EE publications advocate approaches that, while fine in theory, often fail in reality, or deliver no real business value. Expert One-on-One: J2EE Design and Development aims to demystify J2EE development. Using a practical focus, it shows how to use J2EE technologies to reduce, rather than increase, complexity. Rod draws on his experience of designing successful high-volume J2EE applications and salvaging failing projects, as well as intimate knowledge of the J2EE specifications, to offer a real-world, how-to guide on how you too can make J2EE work in practice. It will help you to solve common problems with J2EE and avoid the expensive mistakes often made in J2EE projects. It will guide you through the complexity of the J2EE services and APIs to enable you to build the simplest possible solution, on time and on budget. Rod takes a practical, pragmatic approach, questioning J2EE orthodoxy where it has failed to deliver results in practice and instead suggesting effective, proven approaches. What does this book cover? In this book, you will learn When to use a distributed architecture When and how to use EJB How to develop an efficient data access strategy How to design a clean and maintainable web interface How to design J2EE applications for performance Who is this book for? This book would be of value to most enterprise developers. Although some of the discussion (for example, on performance and scalability) would be most relevant to architects and lead developers, the practical focus would make it useful to anyone with some familiarity with J2EE. Because of the complete design-deployment coverage, a less advanced developer could work through the book along with a more introductory text, and successfully build and understand the sample application. This comprehensive coverage would also be useful to developers in smaller organisations, who might be called upon to fill several normally distinct roles. What is special about this book? Wondering what differentiates this book from others like it in the market? Take a look: It does not just discuss technology, but stress its practical application. The book is driven from the need to solve common tasks, rather than by the elements of J2EE. It discuss risks in J2EE development It takes the reader through the entire design, development and build process of a non-trivial application. This wouldn't be compressed into one or two chapters, like the Java Pet Store, but would be a realistic example comparable to the complexity of applications readers would need to build. At each point in the design, alternative choices would be discussed. This would be important both where there's a real problem with the obvious alternative, and where the obvious alternatives are perhaps equally valid. It emphasizes the use of OO design and design patterns in J2EE, without becoming a theoretical book

More on

Mentioned in questions and answers.

I hear a lot about spring, people are saying all over the web that Spring is a good framework for web development. But what exactly is it for? How can I use it for my Web-Java application development? any examples ?.

Spring started off as a fairly simple dependency injection system. Now it is huge and has everything in it (except for the proverbial kitchen sink).

But fear not, it is quite modular so you can use just the pieces you want.

To see where it all began try:

It might be old but it is an excellent book.

For another good book this time exclusively devoted to Spring see:

It also references older versions of Spring but is definitely worth looking at.

What is the best way to start with spring framework, I've already got a book Spring in action 2nd edition august 2007, but here is the thing, I'm missing some general knowledge concerning this framework and java. I've started reading the book but its not very clear to me, its clear what the author is trying to accomplish but I can't seem to re-write his examples. I'm using eclipse for code writing and I'm somewhat confused where to put xml file and where java files .. etc .

I used the book "Spring Persistence a running Start" and some tutorials I found on the web for eclipse/java/maven etc. and was up and running(-ish) within a couple of weeks. I also had other spring books at my disposal, but found the "running start" one by far the best as it covered JPA and hibernate as well.

Here's the link

4 Things you will need

  1. Spring Recipes by Gary Mak
  2. Sun's Java Tutorial for your Java brushing up
  3. Spring reference manual for 2.5.6 (Spring 3 is still in RC1)
  4. Spring 2.5.6 API docs

You have to buy Spring Recipes but it is a def MUST have, it will help you a lot and the others are free and indispensable. BTW Craig Walls book is quite good as well. You should also download the refcardz for Spring Configuration (also by Craig Walls) and Spring Annotations.

I've found that the tutorials for the Appfuse framework are a great way to get aquainted with the basic features of Spring.

Although they are a few years old, I'd also recommend any of the books by Rod Johnson where he lays out the the Spring design and philosophy: Expert One-on-One J2EE Design and Development, Expert One-on-One J2EE Development without EJB, and Professional Java Development with the Spring Framework.

The Spring documentation is great and I still usually learn something new every time I visit there. The first few chapters will help you understand some of the core concepts of Spring (i.e. Inversion of Control/Dependency Injection).

Spring Roo is a new project that can help you build the infrastructure for a Spring-based application quickly, but I haven't seen any tutorials for it yet that would help you understand it yet.

I will need to build some complex GUI (approx a 100 of views). So we need to parallelize the development as much as possible (maybe on 10 devs). One option is to develop with html, css (compass) and JQuery+plugin in a classic way. We know exactly how to do and there is no question about that.

The other option is to use GWT, but we worried about how much development is parallelizable with GWT. We want to massively use Ajax and our 100 views will be hosted on 5 pages max.

Any experience return with such concern will be greatly appreciated.


GWT is great for parallel development but beware of the learning curve !

IMO GWT is more for OO developpers to write UI code than for Js developpers.

Java (like many other OO languages) allows you to split classes in many little files, allowing many people to work on the project simultaneously. Design patterns can help you factor complex programming patterns into reusable blocks. Most used patterns with GWT are MVP (an alternative version of MVC), Observer (with the eventBus), Command (with gwt-dispatch), ... Besides you can also use things like dependency injection with Gin so that modules can be composed easily, based on their interface (being implemented or not).

So GWT is great for Java developpers. They can use pattern they (should) master, and they (most of the time) don't have to worry about browser-specific details or Javascript.

A lot of developpers with a JavaScript background have a tendency, at least in the beginning, to code in Java as if it were JavaScript. The style is different and it takes a lot of time to be able to produce well-designed Java code, not too mention GWT where patterns and GWT-specific design are crucial and not always well documented. Anybody can write in Java, but the tens of books and billions of crappy lines of code around clearly indicate that it is not so easy to produce good OO code.

The same goes for Js. Put a Java developper on a Js project and watch the code being messed up within hours.

As Rod Johnson (father of Spring framework) says in his great book expert one on one j2ee design and development, when choosing a technology you should make a decision based on the skills you have !

So if I had a killer team with Javascript, HTML and CSS, who has limited knowledge about the above patterns or Java, I would tell them to learn about Ember (if they don't know it already) or any other Javascript MVC framework which also facilitates parallel development, buy books like "Maintainable JavaScript" or "Javascript patterns", and have everybody continue to do what they do best.

If the team is motivated by a new tech and wants to try GWT, I would put one or two of them on a proof-of-concept for at least a month. If they feel comfortable with GWT I would hire the best GWT consultant around, have him check once a week that we use the right tools and the right patterns in the right place, and have the team embrace GWT. I'd at least budgetize 3 to 6 months for everybody to get up to speed, depending on their knowledge of Java and the above patterns.

Here is my own experience.

We hired two medior consultants with no GWT background for a one-year project with 6 people who had a background in procedural programmation for half of them and in plain not-too-fancy Java for the other half.

The consultants behaved as if it was a payed self-training opportunity. Most design decision where taken by outsourced people and the team didn't have a chance to make his own mistakes and learn from them. At the moment (one year later) everybody improved but we are still struggling with the patterns, tools and design problems. It took me one month to read the GWT doc and two books about the subject but at least 4 months of hands-on dev to start figuring out I was wrong in many places. I learn new stuff about GWT every day and discover new bad design decisions we made every two other week.