Master Java EE design pattern implementation to improve your design skills and your application’s architecture

Professional Java EE Design Patterns is the perfect companion for anyone who wants to work more effectively with Java EE, and the only resource that covers both the theory and application of design patterns in solving real-world problems. The authors guide readers through both the fundamental and advanced features of Java EE 7, presenting patterns throughout, and demonstrating how they are used in day-to-day problem solving.

As the most popular programming language in community-driven enterprise software, Java EE provides an API and runtime environment that is a superset of Java SE. Written for the junior and experienced Java EE developer seeking to improve design quality and effectiveness, the book covers areas including:

  • Implementation and problem-solving with design patterns
  • Connection between existing Java SE design patterns and new Java EE concepts
  • Harnessing the power of Java EE in design patterns
  • Individually-based focus that fully explores each pattern
  • Colorful war-stories showing how patterns were used in the field to solve real-life problems

Unlike most Java EE books that simply offer descriptions or recipes, this book drives home the implementation of the pattern to real problems to ensure that the reader learns how the patterns should be used and to be aware of their pitfalls.

For the programmer looking for a comprehensive guide that is actually useful in the everyday workflow, Professional Java EE Design Patterns is the definitive resource on the market.

Professional Java EE Design Patterns

Advertisements

Chapter 1: A Brief Overview of Design Patterns

In chapter 1 we present an overview of what design patterns are by sharing a short history of design patterns and why they are so important to know and use. We continue by talking about the use of design patterns in the real world.

As the main focus of this book we spend a little time on the history and evolution of Java Enterprise Edition so far and how the emergence of enterprise patterns have influenced the way we develop.  Java EE design patterns have evolved substantially in the enterprise environment.

We finish the chapter by discussing the ‘why and how’ of patterns become anti-patterns.

Professional Java EE Design Patterns

Chapter 1: A Brief Overview of Design Patterns

Chapter 2: The Basics of Java EE

In chapter 2 we introduce you to the core concepts of Java EE, such as context dependency injection, convention over configuration and interceptors, that are necessary to know in order to make the best of this book.

We finish the chapter with a discussion of the multi-tier structure of an enterprise application and an explanation of Java EE–compliant servers and the web profile.

Professional Java EE Design Patterns

Chapter 2: The Basics of Java EE

Chapter 3: Façade Pattern

In this chapter we introduce the intent of the façade pattern with a brief discussion of the benefits that the implementation of this pattern brings.

We continue by discussing three ways that the pattern can be implemented: POJO, stateless and stateful session bean façade and the important differences between the stateful and stateless session bean façade.

The chapter ends with a discussion of when and where to use this pattern and warnings about its use and potential pit-falls.

Professional Java EE Design Patterns

Chapter 3: Façade Pattern

Chapter 4: Singleton Pattern

In this chapter we will examine the different ways that a developer can implement the singleton design pattern, its common usage and pitfalls. We start by using static members and methods and demonstrate the problems this causes in multi-threaded environments.

We will see the advances that were made in Java SE 5 with the introduction of the enum type and how it can be used to create thread safe singletons. Then we will discuss the use of the @Singleton annotation in Java EE and how this has radically changed the way we implement the singleton pattern in session beans.

We will introduce the use of BEAN and CONTAINER managed concurrency and we will see how the use of the @LockType annotation controls access to business methods. We finish the chapter with a discussion of the main issues that have dogged the singleton pattern and why it is considered an anti-pattern and has fallen out of favour.

Professional Java EE Design Patterns

Chapter 4: Singleton Pattern

Chapter 5: Dependency Injection and CDI

In this chapter we introduce the concept of dependency injection and why it is so important in Java EE. The we go on to show how to implement dependency injection in Java SE.

We continue by discussing how dependency injection is implemented in Java EE and introduce context dependency injection by discussing the key differences between context dependency injection and the enterprise Java bean container.

Professional Java EE Design Patterns

Chapter 5: Dependency Injection and CDI