Book Review: EJB 3 in Action, Second Edition

This is a review of the book EJB 3 in Action, Second Edition


What is this book about?

This book is essentially about EJB 3 with a prime focus on the latest version i.e. EJB 3.2. The book is aligned with the latest version of Java EE i.e. Java EE 7 and its related specifications, APIs and standards. It serves as a comprehensive guide to EJB 3 as a standard and covers almost ALL its aspects, some of which are,

  • Basic tenets, principles, architecture of EJB 3
  • Internal implementations (from a Java EE container/run time environment perspective)
  • Integration with other specifications/technologies like JPA 2.1, JSF, CDI 1.1, JAX-RS 2.0 (RESTful web services), WebSockets 1.0 (real time full-duplex applications), JAX-WS (SOAP web services)
  • Practical code to demonstrate application of concepts to implement real world use cases
  • Application testing – isolated and integration
  • Application Deployment
  • Best practices, recommendations, performance tuning

Who has written this book?

This book has been co-authored by 4 gentlemen who are distinguished authors, developers, Java architects and community leaders.

  • Debu Panda
  • Reza Rahman
  • Ryan Cuprak
  • Michael Remijan

Is this book for you ? How can you benefit from it ?

The book humbly states that – “This book is ideally suited for a Java developer with a couple of years’ experience who is curious about EJB 3”. This is correct to an extent. In my opinion though, this book caters to a broad category of audience

Developers (at various stages of their careers)

  • Beginner – folks who are coming to terms with Java EE, its goals, concepts, technologies and of course, it’s specifications. More often than not, it’s the EJBs, JMS, Serlvets which which are primary targets since they are the first Java EE specs to evolve, are the very foundation of Java EE as a technology stack and tend to encapsulate the spirit of Java EE. This book does not assume any prior exposure to Java EE and covers all the bases required for a beginner
  • Intermediate – Ones who are relatively well versed with the Java EE stack and ecosystem, but do need revisit the basics or get hold of that vital piece of info which might help them skyrocket thier current assignment/project
  • Advanced – Folks with strong Java EE development background can always come back and refer to this book since it aligns with Java EE 7 in general and covers the latest and greatest version of EJB i.e. 3.2 and other other vital specifications such as JPA 2.1, CDI 1.1, JAX-RS 2.0, JMS 2.0, WebSockets 1.0

Seasoned Architects and Java EE Technical Leads can benefit from this book by referring to sections which talk about the best practices, recommendations and design patterns. Almost each module talks about using that particular component effectively and efficiently. Some of the examples are best practices with respect to Session and Message Driven beans, EJB security, CDI, application deployment, performance tuning etc

This is an ideal book for Oracle’s EJB3 Developer Certification aspirants – it’s packed with real world examples, has a practical and code driven approach and is easy going and conversational in nature

Having said all that, the book does assume that the reader has reasonable familiarity with the Java language in general, which is a perfectly reasonable prerequisite since Java EE builds on Java SE and the Java Platform itself.

So, you have read the First Edition? How different is the Second Edition?

The first edition came out back in 2007. That was the time when Java EE 5 was ruling the roost. Needless to say, it’s 2014, and Java EE has changed significantly since then with Java EE 7 being the latest version. The book been adapted to factor-in these changes

  • Aligned with EJB 3.2 (latest version of the EJB specification)
  • Covers Singleton and Asynchronous Session Beans
  • Discusses EJB and JAX-RS integration for RESTful web services
  • Dedicated module for CDI and it’s integration points with EJB
  • In depth coverage of brand new WebSocket API introduced in Java EE 7 and how it can be used in tandem with EJB 3.2 to build real time and highly scalable applications
  • Also in general, the reader is bound to benefit from the content about the latest versions of other Java EE 7 specifications as well, such as JPA 2.1, JSF 2.2 etc

 What does the book cover?

Part 1 – must read for beginners

  • Serves as a comprehensive introduction to EJB ecosystem including its architecture, types and new features (in EJB 3.2)
  • Code driven tour of the EJB technologies with the help of a real world eCommerce Bidding application. Gives the reader a feel of how EJBs can be used for actual hard core development and how they can be practically integrated with other related technologies like JSF, JPA, CDI, WebSockets, Web Services etc (these technologies are in fact introduced prior to in-depth discussion/references)

Part 2 – builds upon the concepts introduced in Part 1

  • Answers the WHYs, WHENs and HOWs of Session and Message Driven beans (including a brief peek into JMS)
  • Covers Transactions in an easy-to-understand fashion and helps correlate it with respect to the EJB world
  • Delves into other fundamental concepts such as EJB Security as well as Schedulers, Timers
  • Deals with advanced EJB concepts like AOP, DI and gives us a peek into the EJB world from the perspective of the EJB Container i.e. the run time itself and how to access it’s Services via the EJBContext interface
  • Showcases the versatility of EJBs and deals with how to expose EJBs as Web Services (REST and SOAP) and leverage to build a SOA based solution

Part 3 – focuses on Java EE specs/technologies which are closely related to EJB

  • In depth coverage of JPA and its concepts ORM and Domain Modelling
  • EJB-JPA integration layer, which includes EntityManager and its related concepts (bread and butter of the JPA) and extensive code driven discussion about JPQL
  • Although CDI was introduced as a dedicated specification in Java EE 6, it’s still relatively new and grasping the concepts can get tricky. This book discusses CDI and its fundamentals (decorators, stereotypes, events etc) in an intuitive, practical and example driven fashion. It then talks about how EJB and CDI interplay/integrate with each other in the context of a Java EE application

Part 4 – it’s all about the Action!

  • Covers Java EE components (EJB, JPA, CDI etc) packaging and deployment in an in-depth fashion including a thorough explanation of Java EE class loading and module system
  • WebSockets is a brand new spec added in Java EE 7 and deserves a dedicated book to itself, but this book explains WebSockets effectively !
  • Discusses EJB testing in an isolated fashion (unit testing) using JUnit and Mockito as well as with the help of embedded containers and Arquillian (integration testing)

Apart from the all chunk of the content which resides in the aforementioned units/modules, the book also covers the following

  • Guides the reader through the Java EE 7 SDK install process, managing the GlassFish Application server and executing a basic Hello World application
  • Discusses Oracle’s EJB 3 Developer Certification exam. It takes into consideration a newbie and explains the complete process, right from the pre-requisites, registration process, how to prepare etc
  • Provides a reference to the EJB Deployment descriptor (better known as the ejb-jar.xml) – talks about its various XML tags/elements

 Standout features

  • Does not rely on the reader having EJB experience or exposure to related specs/technologies like JSF, JPA, JSP etc
  • The overall demeanor of the book is informal and easy going which sets it apart from a regular Java EE related book
  • It demonstrates how to solve real world problems with code driven examples and sample applications
  • The manner in which related Java EE specifications have been covered is quiet heartening to see. Technologies like JPA, CDI, JAX-RS, WebSockets (new in Java EE 7) deserve a book dedicated to them, but the way they have been dealt with and explained in this book, makes the reader feel as if it’s a free bonus 😉 This is in my opinion is one of the major highlights !
  • Covers Oracle EJB 3 Certification process – rare feature in any book and it clearly reflects that the book is aimed at th
  • A special mention about Chapter 13, which is titled, Packaging EJB 3 applications – Do not be fooled by the humble naming convention. This chapter takes application packaging and deployment very seriously indeed. It pays attention to packaging different artifacts such as Session and Message Drive beans, JPA, CDI components – illustrated with flow charts and diagrams! it also explains the Java EE module system, Java EE Class Loading – which in fact drive the standards behind specific ways of packaging and deploying Java EE applications
  • Consistently adds best practices, recommendations section to most of the discussed modules/sections of the book


For a technology stack which is as comprehensive and advanced as Java EE, it can get a little intimidating, especially for a relative new comer. One can often get lost in the vast sea of standards, specifications, APIs, multiple implementations etc. The right thing to do is to stick to the basics first

  • EJB (for core business logic)
  • JPA (data access layer)
  • JSF (presentation layer)
  • CDI (Dependency injection, cross cutting logic, event based messaging)
  • JAX-RS (REST-fully exposing your functionality over HTTP to heterogeneous clients)

This book will enable you to do exactly that. It helps clear the cloud, clarify the concepts, build strong fundamentals, see Java EE for what it really is and empowers you to explore the rest . . .

Excited Already?

CLICK HERE to grab your copy now !!!

Happy Reading 🙂


About Abhishek

Loves Go, NoSQL DBs and messaging systems
This entry was posted in Java, Java EE and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s