Design Pattern

Core J2EE Patterns – Best Design Practices

<p>The <strong>Core J2EE patterns<&sol;strong> deal with testing on the presentation tier as offered by Sun Java Center&period; J2EE stands for Java 2 Enterprise Edition currently known as Java Enterprise Edition &lpar;J EE&rpar;&period; It consists of many APIs that provide software developers with the capabilities to write server-side code&period; These design patterns are specifically concerned with the following listed layers&period;<&sol;p>&NewLine;<ul>&NewLine;<li>Presentation Layer<&sol;li>&NewLine;<li>Business Layer<&sol;li>&NewLine;<li>Integration Layer<&sol;li>&NewLine;<&sol;ul>&NewLine;<div style&equals;"background-color&colon; &num;f2f9fc&semi; border-radius&colon; 3px&semi; border&colon; 1px solid &num;c9e6f2&semi; line-height&colon; 1&period;45&semi; padding&colon; 16px 16px 16px 16px&semi;">&NewLine;<h2 dir&equals;"ltr">Spring 5 Design Pattern Book<&sol;h2>&NewLine;<div dir&equals;"ltr" style&equals;"color&colon; &num;20124d&semi; font-family&colon; 'calibri' &comma; sans-serif&semi; font-size&colon; 13pt&semi; text-align&colon; justify&semi;">You could purchase my <strong>Spring 5 book<&sol;strong> that is with title name &&num;8220&semi;<strong>Spring 5 Design Patterns<&sol;strong>&&num;8220&semi;&period; This book is available on the <a href&equals;"https&colon;&sol;&sol;www&period;amazon&period;in&sol;Spring-Design-Patterns-Dinesh-Rajput&sol;dp&sol;1788299450&sol;ref&equals;sr&lowbar;1&lowbar;1&quest;ie&equals;UTF8&amp&semi;qid&equals;1507925340&amp&semi;sr&equals;8-1&amp&semi;keywords&equals;spring&plus;5&plus;design&plus;pattern"><strong>Amazon<&sol;strong><&sol;a> and <a href&equals;"https&colon;&sol;&sol;www&period;packtpub&period;com&sol;application-development&sol;spring-5-design-patterns"><strong>Packt<&sol;strong><&sol;a> publisher website&period; Learn various <strong>design patterns<&sol;strong> and <strong>best practices<&sol;strong> in Spring 5 and use them to solve common design problems&period; You could use author discount to purchase this book by using code- &&num;8220&semi;<strong>AUTHDIS40<&sol;strong>&&num;8220&semi;&period;<&sol;div>&NewLine;<div dir&equals;"ltr"><&sol;div>&NewLine;<div dir&equals;"ltr"><a href&equals;"https&colon;&sol;&sol;www&period;amazon&period;in&sol;Spring-Design-Patterns-Dinesh-Rajput&sol;dp&sol;1788299450&sol;ref&equals;sr&lowbar;1&lowbar;1&quest;s&equals;books&amp&semi;ie&equals;UTF8&amp&semi;qid&equals;1512607966&amp&semi;sr&equals;1-1&amp&semi;keywords&equals;dinesh&plus;rajput"><br &sol;>&NewLine;<img class&equals;"aligncenter wp-image-3053 size-medium" title&equals;"Spring-5-Design-Pattern" src&equals;"https&colon;&sol;&sol;i0&period;wp&period;com&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2013&sol;03&sol;Spring-5-design-pattern&period;jpg&quest;resize&equals;243&percnt;2C300&amp&semi;ssl&equals;1" alt&equals;"Spring-5-Design-Pattern" width&equals;"243" height&equals;"300" &sol;><&sol;a><&sol;div>&NewLine;<&sol;div>&NewLine;<p><img class&equals;"aligncenter size-full wp-image-3647" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2012&sol;03&sol;CoreJ2EEPatternCatalog&period;jpg" alt&equals;"Core J2EE Pattern Catalog" width&equals;"772" height&equals;"543" &sol;><&sol;p>&NewLine;<h3>Presentation Tier<&sol;h3>&NewLine;<ul>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;intercepting-filter-design-pattern&sol;"><strong>Intercepting Filter<&sol;strong><&sol;a><br &sol;>&NewLine;It is used to provide interception and manipulation of requests as well as response prior to and preceding the processing of the request&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;intercepting-filter-design-pattern&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;context-object-design-pattern&sol;"><strong>Context Object<&sol;strong><&sol;a><br &sol;>&NewLine;Context Object is present to keep from using system information that is specific to the protocol and doesn’t coincide with its context&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;context-object-design-pattern&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;front-controller-design-pattern&sol;"><strong>Front Controller<&sol;strong><&sol;a><br &sol;>&NewLine;A centralized access point allows for non-duplication of the control logic needed to handle a request&period; Front Controller is to handle such request by acting as an initial point&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;front-controller-design-pattern&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;application-controller-design-pattern&sol;"><strong>Application Controller<&sol;strong><&sol;a><br &sol;>&NewLine;It provides support for action reuse and code to view-management&period; The code is made more readable and maintainable as well as modular&period; Request handling is also improved and made more extensible&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;application-controller-design-pattern&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;view-helper-design-pattern&sol;"><strong>View Helper<&sol;strong><&sol;a><br &sol;>&NewLine;It is used to provide a different view&comma; hiding the logic present in the code&period; Now the logic and the view are completely independent to provide ease for developers and designers&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;view-helper-design-pattern&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;composite-view-design-pattern&sol;"><strong>Composite View<&sol;strong><&sol;a><br &sol;>&NewLine;Small sub views can be created using the composite view&period; These sub views can be integrated to create a singular view&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;composite-view-design-pattern&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;dispatcher-view-design-pattern&sol;"><strong>Dispatcher View<&sol;strong><&sol;a><br &sol;>&NewLine;To be able to support a small amount of multitasking&comma; dispatcher view is used&period; It provides handling and response generation for requests while a business processing is taking place&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;dispatcher-view-design-pattern&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;service-to-worker&sol;"><strong>Service to Worker<&sol;strong><&sol;a><br &sol;>&NewLine;It is used to perform handling of requests as well as processing of the business transaction and after that&comma; the control is transferred to the View&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;service-to-worker&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<&sol;ul>&NewLine;<h3>Business Tier<&sol;h3>&NewLine;<ul>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;business-delegate&sol;"><strong>Business Delegate<&sol;strong><&sol;a><br &sol;>&NewLine;The business delegate pattern is one of the Java EE design patterns&period; It is used in order to decouple or reduce the coupling between the presentation tier and business services&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;business-delegate&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;service-locator&sol;"><strong>Service Locator<&sol;strong><&sol;a><br &sol;>&NewLine;The design pattern&comma; service locator is an important part in software development&period; Looking up for a service is one of the core features of service locator&period; A robust abstraction layer performs this function&period; The design pattern uses a central registry called Service Locator&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;service-locator&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;session-facade&sol;"><strong>Session Facade<&sol;strong><&sol;a><br &sol;>&NewLine;The session façade pattern&&num;8217&semi;s core application is development of enterprise apps&period; You can also call it a logical extension of GoF designs&period; The pattern encases the interactions which are happening between the low-level components&comma; which is Entity EJB&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;session-facade&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;business-object&sol;"><strong>Business Object<&sol;strong><&sol;a><br &sol;>&NewLine;Object-oriented programming makes use of the business object&period; It represents the parts of a business&period; A business object is able to represent things like event&comma; person&comma; business process&comma; place&comma; and concept&period; The business object can exist in certain forms like a product&comma; an invoice&comma; and the details of a particular part of a transaction&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;business-object&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;composite-entity-pattern&sol;"><strong>Composite Entity<&sol;strong><&sol;a><br &sol;>&NewLine;It is one if the Java EE software-design patterns&period; The composite entity pattern performs modeling&comma; managing and representing a set of interrelated persistent objects&period; It does not represent them as separate fine-grained entity beans&period; Composite entity beans are able to represent a graph of objects&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;composite-entity-pattern&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;transfer-object&sol;"><strong>Transfer Object<&sol;strong><&sol;a><br &sol;>&NewLine;It is one of the Java EE design patterns&period; We need transfer object when we need to pass the data across various attributes in a packet to the server&period; Value Object is another name for transfer object&period; The transfer object is just a class of POJO which has a method of the getter and setter&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;transfer-object&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<&sol;ul>&NewLine;<h3>Integration Tier<&sol;h3>&NewLine;<ul>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;data-access-object&sol;"><strong>Data Access Object<&sol;strong><&sol;a><br &sol;>&NewLine;The data access object in a computer software which is as an object which is responsible for providing abstract interface for communication to a specific form of database&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;data-access-object&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;service-activator&sol;"><strong>Service Activator<&sol;strong><&sol;a><br &sol;>&NewLine;The service activator design pattern is one of the Java EE patterns&period; It is an SI &lpar;spring integration&rpar; component&period; It is responsible for triggering or activating a service object or bean which is managed by the spring&period; A service activator searches through the message channel in order to look for messages&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;service-activator&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;web-service-broker&sol;"><strong>Web Service Broker<&sol;strong><&sol;a><br &sol;>&NewLine;The web service broker uses web protocols and XML&period; We can use this pattern to expose and broker the services&period; Assume a circumstance&comma; where multiple organizations are lined up in order to request info from a number of service providers&period;  <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;web-service-broker&sol;"> <img class&equals;"wp-image-4083" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;readmore-1&period;png" alt&equals;"readmore" width&equals;"117" height&equals;"17" &sol;><&sol;a><&sol;li>&NewLine;<&sol;ul>&NewLine;<div class&equals;"wp-post-navigation"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-pre"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;facade-design-pattern&sol;">Previous<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-next"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;business-delegate&sol;">Next<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;<&sol;div>&NewLine;<script type&equals;"text&sol;javascript">&NewLine;jQuery&lpar;document&rpar;&period;ready&lpar;function&lpar;&dollar;&rpar; &lbrace;&NewLine; &dollar;&period;post&lpar;'https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-admin&sol;admin-ajax&period;php'&comma; &lbrace;action&colon; 'mts&lowbar;view&lowbar;count'&comma; id&colon; '4047'&rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;<&sol;script>

Dinesh Rajput

Dinesh Rajput is the chief editor of a website Dineshonjava, a technical blog dedicated to the Spring and Java technologies. It has a series of articles related to Java technologies. Dinesh has been a Spring enthusiast since 2008 and is a Pivotal Certified Spring Professional, an author of a book Spring 5 Design Pattern, and a blogger. He has more than 10 years of experience with different aspects of Spring and Java design and development. His core expertise lies in the latest version of Spring Framework, Spring Boot, Spring Security, creating REST APIs, Microservice Architecture, Reactive Pattern, Spring AOP, Design Patterns, Struts, Hibernate, Web Services, Spring Batch, Cassandra, MongoDB, and Web Application Design and Architecture. He is currently working as a technology manager at a leading product and web development company. He worked as a developer and tech lead at the Bennett, Coleman & Co. Ltd and was the first developer in his previous company, Paytm. Dinesh is passionate about the latest Java technologies and loves to write technical blogs related to it. He is a very active member of the Java and Spring community on different forums. When it comes to the Spring Framework and Java, Dinesh tops the list!

Share
Published by
Dinesh Rajput

Recent Posts

Strategy Design Patterns using Lambda

Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…

4 years ago

Decorator Pattern using Lambda

Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…

4 years ago

Delegating pattern using lambda

Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…

4 years ago

Spring Vs Django- Know The Difference Between The Two

Technology has emerged a lot in the last decade, and now we have artificial intelligence;…

4 years ago

TOP 20 MongoDB INTERVIEW QUESTIONS 2022

Managing a database is becoming increasingly complex now due to the vast amount of data…

4 years ago

Scheduler @Scheduled Annotation Spring Boot

Overview In this article, we will explore Spring Scheduler how we could use it by…

4 years ago