Java EE 6 Book

Presentation

In today’s business world, applications need to access data, apply business logic, add presentation layers, and communicate with external systems. That’s what companies are trying to achieve while minimizing costs, using standard and robust technologies that can handle heavy loads. If that’s your case, you have the right book in your hands.

Java Enterprise Edition appeared at the end of the 1990s and brought to the Java language a robust software platform for enterprise development. Challenged at each new version, badly understood or misused, overengineered, and competing with open source frameworks, J2EE was seen as a heavyweight technology. Java EE benefited from these criticisms to improve and is today focused on simplicity.

If you are part of the group of people who still think that “EJBs are bad, EJBs are evil,” read this book, and you’ll change your mind. EJBs (Enterprise Java Beans) are great, as is the entire Java EE 6 technology stack. If, on the contrary, you are a Java EE adopter, you will see in this book how the platform has found equilibrium, through its ease of development in all the stacks, new specifications, lighter EJB component model, profiles, and pruning. If you are a beginner in Java EE, this is also the right book: it covers the most important specifications in a very understandable manner and is illustrated with a lot of code and diagrams to make it easier to follow.


Open standards are collectively one of the main strengths of Java EE. More than ever, an application written with JPA, EJB, JSF, JMS, JSF, SOAP web services, or RESTful web services is portable across application servers. Open source is another of Java EE’s strengths. As you’ll see in this book, most of the Java EE 6 Reference Implementations use open source licensing (GlassFish, EclipseLink, Mojarra, OpenMQ, Metro, and Jersey).
This book explores the innovations of this new version, and examines the various specifications and how to assemble them to develop applications. Java EE 6 consists of nearly 30 specifications and is an important milestone for the enterprise layer (EJB 3.1, JPA 2.0), for the web tier (Servlet 3.0, JSF 2.0), and for interoperability (SOAP web services and RESTful services). This book covers a broad part of the Java EE 6 specifications and uses the JDK 1.6 and some well-known design patterns, as well as the GlassFish application server, the Derby database, JUnit, and Maven. It is abundantly illustrated with UML diagrams, Java code, and screenshots.

Structure of the book

This book is not meant to be an exhaustive reference on Java EE 6. It concentrates on the most important specifications and highlights the new features of this release. The structure of the book follows the architecture layering of an application:

Chapter 1 briefly presents Java EE 6 essentials and the tools used throughout the book (JDK, Maven, JUnit, Derby, and GlassFish).

The persistent tier is described from Chapter 2 to Chapter 5 and focuses on JPA 2.0. After a general overview with some hands-on examples in Chapter 2, Chapter 3 dives into objectrelational mapping (mapping attributes, relationships, and inheritance). Chapter 4 shows you how to manage and query entities, while Chapter 5 presents their life cycle, callback methods, and listeners.

To develop a transaction business logic layer with Java EE 6, you can naturally use EJBs. This will be described from Chapter 6 to Chapter 9. After an overview of the specification, its history, and a hands-on example in Chapter 6, Chapter 7 will concentrate on session beans and their programming model, as well as the new timer service. Chapter 8 focuses on the life cycle of EJBs and interceptors, while Chapter 9 explains transactions and security.

From Chapter 10 to Chapter 12, you will learn how to develop a presentation layer with JSF 2.0. After an overview of the specification in Chapter 10, Chapter 11 will focus on how to build a web page with JSF and Facelets components. Chapter 12 will show you how to interact with an EJB back end and navigate through pages.

Finally, the last chapters will present different ways to interoperate with other systems. Chapter 13 will show you how to exchange asynchronous messages with Java Message Service (JMS) and Message-Driven Beans (MDBs). Chapter 14 focuses on SOAP web services, while Chapter 15 covers RESTful web services.

Download and install the application

Download the code of the examples.

Software used to develop

Personally I’ve used Intellij Ideato develop the code that goes with the book. I’ve been using it for a long time at work. I’ve asked the guys of JetBrain if they would give me license for free so I could use this great IDE for my book. They accepted. I would like to thank them and tell them how good their tool is.

The UML diagrams that you see all over the book are made with Visual Paradigm. I’ve used the plugin version for Intellij Idea. Visual Paradigm makes you love UML, it’s so simple to draw a diagram, to generate code or reverse ingineer it. Again, I would like to thank the company which gave me a license for the product.

5 thoughts on “Java EE 6 Book

  1. Hi, Antonio. I have bought and read your book about Java EE 6 (Brazilian Portuguese version) and enjoyed it very much. Now I have a better understanding of the whole scope of Java Enterprise Edition. However, I think the example listBooks.jsp in chapter 11 has a problem.

    Since JSPs are compiled to servlets and servlets are singletons, the variable “books” declared with is going to be shared by all clients, causing a concurrency problem. I think it should be declared with thus creating a local variable and avoinding the concurrency issue. Is my understanding right?

    1. The JSP tags didn’t appear…

      “books” declared with “less-than, percent sign, exclamation mark” is going to be shared
      (…)
      should be declared with “less-than, percent sign” (without the exclamation mark).

  2. Pingback: Visions of hope

Leave a Reply