Java EE 8 Design Patterns and Best Practices
eBook - ePub

Java EE 8 Design Patterns and Best Practices

Build enterprise-ready scalable applications with architectural design patterns

Rhuan Rocha, João Purificação

Share book
  1. 314 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Java EE 8 Design Patterns and Best Practices

Build enterprise-ready scalable applications with architectural design patterns

Rhuan Rocha, João Purificação

Book details
Book preview
Table of contents
Citations

About This Book

Get the deep insights you need to master efficient architectural design considerations and solve common design problems in your enterprise applications.

Key Features

  • The benefits and applicability of using different design patterns in JAVA EE
  • Learn best practices to solve common design and architectural challenges
  • Choose the right patterns to improve the efficiency of your programs

Book Description

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.

What you will learn

  • Implement presentation layers, such as the front controller pattern
  • Understand the business tier and implement the business delegate pattern
  • Master the implementation of AOP
  • Get involved with asynchronous EJB methods and REST services
  • Involve key patterns in the adoption of microservices architecture
  • Manage performance and scalability for enterprise-level applications

Who this book is for

Java developers who are comfortable with programming in Java and now want to learn how to implement design patterns to create robust, reusable and easily maintainable apps.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Java EE 8 Design Patterns and Best Practices an online PDF/ePUB?
Yes, you can access Java EE 8 Design Patterns and Best Practices by Rhuan Rocha, João Purificação in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Java. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781788837736

Security Patterns

In this chapter, we will look at security pattern concepts and how they can help us to implement better security applications. We will also learn about the single-sign-on pattern and how this can help us to provide a secure application. In addition, we will learn about the authentication mechanism and authentication interceptor, focusing on how to implement those concepts. After reading this chapter, we will be able to create a security application and implement it using Java EE 8. The topics covered in this chapter are as follows:
  • Explaining the concept of security patterns
  • Explaining the concept of the single-sign-on pattern
  • Implementing the single-sign-on pattern
  • Explaining the authentication mechanism
  • Implementing the authentication mechanism
  • Explaining the authentication interceptor
  • Implementing the authentication interceptor

Explaining the concept of security patterns

Applications have a close relationship with data and its storage. This is because applications basically consist of managing data in order to make it possible to optimize the business using automation tasks, helping with decision-making, organizing tasks, and managing certain areas. Also, many companies need to store delicate data and validate access control. Over time, the demand for security software grew significantly, and many companies increasingly invested in creating safe applications. An integral element of security is security information, which follows these basic principles:
  • Confidentiality: The data should not be accessible to non-authorized users or to any entities that request access to the data.
  • Integrity: The data cannot be updated or modified in a non-authorized manner.
  • Availability: The data should be available when it is needed.
  • Non-repudiation: Users cannot repudiate or deny the relation using data or any other process.
For an application to be safe, it needs to provide at least these basic principles.
Security patterns are a set of solutions to common security problems that occur over and over. A large part of these security patterns works to solve problems about authentication, which is associated with confidentiality and integrity principles. With security patterns, the developer can write software with a high level of security for targeting known problems and issues using solutions that are tested and validated.

Explaining the concept of the single-sign-on pattern

In a business environment, it is very common that, when a user logs in to a system, they are automatically logged into various other systems within the business without having to input their login details more than once. One example of this is Google services. Here, if a user logs in to one Google application (Gmail, YouTube, Google Drive), they are logged in to all the available Google services. For example, if we log in to Gmail, we can access YouTube without having to log in again.
Single-sign-on is a security pattern that creates an authentication service that is shared with several applications of a domain to make the centered validation of authentication and authenticates a user only once in this domain. The user can then access all applications of this domain without having to authenticate again. All applications that depend on this type communicate with service authentication in order to validate the authentication of a user and log in if they are not yet logged in. These applications can be made in any language or technology and can stay in several networks or separate physical locations. In the following diagram, we can see the process of authentication using single-sign-on:
In the preceding figure, we have three applications that are accessed by a user as well as a single point to log in and validate authentication. This single point is shown in our diagram by Authentication Service. When a user (represented by Actor in the diagram) sends a request to an application (Application 1, Application 2, or Application 3), this application waits for Authentication Service to validate whether the user is logged in. If not, they are redirected to the login page, and the user can log in there. Afte...

Table of contents