Book Image

Java EE 8 Design Patterns and Best Practices

By : Rhuan Rocha, Joao Carlos Purificação
Book Image

Java EE 8 Design Patterns and Best Practices

By: Rhuan Rocha, Joao Carlos Purificação

Overview of this book

Patterns are essential design tools for Java developers. Java EE Design Patterns and Best Practices helps developers attain better code quality and progress to higher levels of architectural creativity by examining the purpose of each available pattern and demonstrating its implementation with various code examples. This book will take you through a number of patterns and their Java EE-specific implementations. In the beginning, you will learn the foundation for, and importance of, design patterns in Java EE, and then will move on to implement various patterns on the presentation tier, business tier, and integration tier. Further, you will explore the patterns involved in Aspect-Oriented Programming (AOP) and take a closer look at reactive patterns. Moving on, you will be introduced to modern architectural patterns involved in composing microservices and cloud-native applications. You will get acquainted with security patterns and operational patterns involved in scaling and monitoring, along with some patterns involved in deployment. By the end of the book, you will be able to efficiently address common problems faced when developing applications and will be comfortable working on scalable and maintainable projects of any size.
Table of Contents (20 chapters)
Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
5
Aspect-Oriented Programming and Design Patterns
Index

Defining the difference between design patterns and enterprise patterns


Comparing design patterns with enterprise patterns is not an easy task, because some behaviors are similar. Design patterns were the first subject that arrived, and this was covered in Design Patterns: Elements of Reusable Object-Oriented Software, written by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides. These design patterns were also the base to other patterns. Enterprise patterns became necessities that design patterns cannot resolve. This is because thedesign patternsdescribe solutions for of classes and objects relationships, but the enterprise environments have other necessities such as integrations between systems and software relations. However, enterprise patterns use some design patterns to solve problems.

The principal difference between design patterns and enterprise patterns is the aim; design patterns aim to organize and optimize the object-oriented design, and enterprise patterns focus on improving the use of Java EE tools as well as making communications between Java EE components better. Design patterns are focusedon object-oriented and class and object relations,whereas enterprise patterns are focused on communication between Java EE components.

 

 

The use of design patterns makes it possible to reuse algorithms and also makes the design flexible; enterprise design patterns promote an abstraction of the complexity of Java EE tools and make it easier for the architecture to make changes.

Because of the complexity of architecture, the minimal use of enterprise patterns tends to be worse than the minimal use of design patterns. This is because, with the lack of use of enterprise patterns, the professional will always work with Java EE's complexity, increasing the probability of error. Some implementations of Java EE patterns are already present in Java EE tools, and this makes them easy to use. In the next chapters, we will describe some of these patterns and their implementation using Java EE tools and see how these patterns will favor the design and architecture of your project.