Design Pattern

Design Patterns in Java with Example Tutorial

<div dir&equals;"ltr" style&equals;"text-align&colon; left&semi;">&NewLine;<h2>What is the design patterns&quest;<&sol;h2>&NewLine;<p><img class&equals;"size-medium wp-image-3073 alignright" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2012&sol;03&sol;design-patterns-in-java-300x43&period;png" alt&equals;"Design Patterns in java" width&equals;"300" height&equals;"43" &sol;>In this design patterns tutorial&comma; we will explain all type of design patterns in java with example&period; A design pattern is a common solution that is used to test generally repetitive problems in software development&period; The design does not exist as a complete program that can be transformed into an object or machine code but&comma; as a template identify problems in the system and provide appropriate solutions&period; The design pattern testing is not present in normal procedural programming and is mostly adopted by developers in Object Oriented environment&period; These provide the interaction on Object-Oriented level involving classes and objects&period;It is used as an efficient programming approach where Object Oriented systems are being developed to provide robustly and error-free software generation&period;<&sol;p>&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 Pattern<&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" target&equals;"&lowbar;blank" rel&equals;"noopener"><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" target&equals;"&lowbar;blank" rel&equals;"noopener"><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;ie&equals;UTF8&amp&semi;qid&equals;1509502296&amp&semi;sr&equals;8-1&amp&semi;keywords&equals;dinesh&plus;rajput" target&equals;"&lowbar;blank" rel&equals;"noopener"><img class&equals;"aligncenter wp-image-3053 size-medium" title&equals;"Spring-5-Design-Pattern" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2013&sol;03&sol;Spring-5-design-pattern-243x300&period;jpg" width&equals;"243" height&equals;"300" &sol;><&sol;a><&sol;div>&NewLine;<h2>Need for Design Patterns<&sol;h2>&NewLine;<p>With the emerging needs of technology and the growth in the IT industry&comma; typical software development practices&comma; that required the completion of the entire software before testing&comma; has also evolved&period; To avoid reverting to the stage of development after completion&comma; a testing practice during development phase was introduced&period; It can be used to identify error conditions and problems in the code that may not be apparent at the time&period; The end modules that are obtained are already tested and are less error-prone&period;<&sol;p>&NewLine;<p>Designing a template that can be reused on multiple codes saves time for test creation and is easy to understand by developers with prior experience working with it&period; The templates are code and problem independent and do not need to be specified by coders to deal with a problem<&sol;p>&NewLine;<h2>Types of Design Patterns<&sol;h2>&NewLine;<p>Design patterns are classified into four main categories and each individual design pattern in the category make up a total of 23 design patterns&period; The four main categories are&colon;<&sol;p>&NewLine;<p><img class&equals;"aligncenter wp-image-3646 size-full" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2012&sol;03&sol;observer-software-design-pattern-5-638&period;jpg" alt&equals;"observer-software-design-pattern-5-638" width&equals;"638" height&equals;"359" &sol;><&sol;p>&NewLine;<ol>&NewLine;<li><strong>Creational Pattern<&sol;strong><&sol;li>&NewLine;<li><strong>Structural Pattern<&sol;strong><&sol;li>&NewLine;<li><strong>Behavioral Pattern<&sol;strong><&sol;li>&NewLine;<li><strong>J2EE Pattern<&sol;strong><&sol;li>&NewLine;<&sol;ol>&NewLine;<h2><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;creational-design-patterns&sol;">Creational Patterns<&sol;a><&sol;h2>&NewLine;<p>Creational Pattern is mostly concerned with the manner involved with creating class instances&period; It is further characterized as class-creation and object-creation Patterns&period; The object creation or instantiation is done implicitly using design patterns rather than directly&period; Thus&comma; for a use-case&comma; there is flexibility involved with the object creation&period;<&sol;p>&NewLine;<ul>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;abstract-factory-design-pattern&sol;"><strong>Abstract Factory<&sol;strong><&sol;a><br &sol;>&NewLine;In this pattern&comma; a factory of related objects is created by an interface without specification of the class name&period; The factory passes the objects by following the Factory Pattern&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;builder-design-pattern&sol;"><strong>Builder<&sol;strong><&sol;a><br &sol;>&NewLine;This pattern is used for a stage by stage creation of a complex object by combining simple objects&period; The final object creation depends on the stages of the creative process but is independent of other objects&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;factory-method-design-pattern&sol;"><strong>Factory Method<&sol;strong><&sol;a><br &sol;>&NewLine;This pattern is employed mostly during development in Java&period; It provides implicit object instantiation through common interfaces&period;<&sol;li>&NewLine;<li><strong>Object Pool<&sol;strong><br &sol;>&NewLine;Object pooling is used to reduce object creation cost when it is high for certain process and thus improves performance&period; It employs the method of object caching and simply retrieves objects from the cache pool instead of having to create it&period; The number of objects in the pool can be restricted to keep from continual growth&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;prototype-design-pattern&sol;"><strong>Prototype<&sol;strong><&sol;a><br &sol;>&NewLine;In Prototype patterns&comma; object duplication is performed while performance is monitored&period; A prototype interface pattern is present to produce a copy of an object&period; It is used to restrict memory&sol;database operations by keeping modification to a minimum using object copies&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;singleton-design-pattern&sol;"><strong>Singleton<&sol;strong><&sol;a><br &sol;>&NewLine;This pattern involves the present of one class and restricting object creation to a single object&period; The presence of a single object removes the need for object instantiation for accessing&period;<&sol;li>&NewLine;<&sol;ul>&NewLine;<h2><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;structural-design-patterns&sol;">Structural Patterns<&sol;a><&sol;h2>&NewLine;<p>Structural Patterns deal with the composition of classes and objects&period; Inheritance is employed for interface composition and methods for addition of new functionalities are introduced by object composition&period; A better understanding of the entity relationship is established&period; Abilities of independent interfaces are combined in structural patterns&period;<&sol;p>&NewLine;<ul>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;adapter-design-pattern&sol;"><strong>Adapter<&sol;strong><&sol;a><br &sol;>&NewLine;To link two interfaces that are not compatible and utilize their functionalities&comma; Adapter pattern is used&period; It is used to provide a new interface covering for any existing class&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;bridge-design-patterns&sol;"><strong>Bridge<&sol;strong><&sol;a><br &sol;>&NewLine;In Bridge Pattern&comma; there is a structural alteration in the main and interface implementer classes without having any effect on each other&period; These two classes are made independent of each other and are only connected by using the bridge which is an interface&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;composite-pattern-design-patterns-java&sol;"><strong>Composite<&sol;strong><&sol;a><br &sol;>&NewLine;Composite Pattern is used group together objects as one object&period; The objects are composed in a tree structure form with the representation of individual tree nodes and the hierarchy as well&period; The objects belonging to the same groups are modified using this pattern&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;decorator-design-pattern&sol;"><strong>Decorator<&sol;strong><&sol;a><br &sol;>&NewLine;Decorator pattern restricts the alteration of object structure while a new functionality is added to it&period; The initial class remains unaltered while a decorator class wraps around it and provides extra capabilities&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;facade-design-pattern&sol;"><strong>Façade<&sol;strong><&sol;a><br &sol;>&NewLine;Façade provides clients with access to the system but conceals the working of the system and its complexities&period; The pattern creates one class consisting of user functions and delegates provide calling facilities to the classes belonging to the systems&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;flyweight-pattern-design-patterns-java&sol;"><strong>Flyweight<&sol;strong><&sol;a><br &sol;>&NewLine;Flyweight pattern is used to reduce memory usage and improve performance by cutting on object creation&period; The pattern looks for similar objects that already exist to reuse it rather than creating new ones that are similar&period;<&sol;li>&NewLine;<li><strong>Private Class Data<&sol;strong><br &sol;>&NewLine;Some of the class attributes may be available without requirement and thus may be prone to be corrupted&period; To prevent that the attributes may be allowed to be manipulated only once during operation after which it becomes private and thus data is protected&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;proxy-pattern-design-patterns-java&sol;"><strong>Proxy<&sol;strong><&sol;a><br &sol;>&NewLine;It is used to create objects that may represent functions of other classes or objects and the interface is used to access these functionalities&period;<&sol;li>&NewLine;<&sol;ul>&NewLine;<h2><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;behavioral-design-pattern&sol;">Behavioral patterns<&sol;a><&sol;h2>&NewLine;<p>Behavioral pattern deals with the communication between class objects&period; They are used to sense the presence of already present communication patterns and may be able to manipulate these patterns&period;<&sol;p>&NewLine;<ul>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;chain-responsibility-pattern&sol;"><strong>Chain of responsibility<&sol;strong><&sol;a><br &sol;>&NewLine;A chain of objects is created to deal with the request so that no request goes back unfulfilled&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;command-pattern-design-patterns-java&sol;"><strong>Command<&sol;strong><&sol;a><br &sol;>&NewLine;Command pattern deals with requests by hiding it inside an object as a command and sent to be to invoker object which then passes it to an appropriate object that can fulfill the request&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;interpreter-pattern-design-patterns-java&sol;"><strong>Interpreter<&sol;strong><&sol;a><br &sol;>&NewLine;Interpreter pattern is used for language or expression evaluation by creating an interface that tells the context for interpretation&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;iterator-pattern-design-patterns-java&sol;"><strong>Iterator<&sol;strong><&sol;a><br &sol;>&NewLine;Iterator pattern is used to provide sequential access to a number elements present inside a collection object without any relevant information exchange&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;mediator-pattern-design-patterns-java&sol;"><strong>Mediator<&sol;strong><&sol;a><br &sol;>&NewLine;Mediator pattern provides easy communication through its mediator class that allows communication for several classes&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;memento-pattern-design-patterns-java&sol;"><strong>Memento<&sol;strong><&sol;a><br &sol;>&NewLine;Memento pattern involves the working of three classes Memento&comma; CareTaker&comma; and Originator&period; Memento holds the restorable state of the object&period; Originator’s job is the creation and storing of state and CareTaker’s job is the restoration of memento states&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;null-object-pattern&sol;"><strong>Null Object<&sol;strong><&sol;a><br &sol;>&NewLine;Null Object is used instead of specifying a Null value and is used to represent a particular operation that does nothing when created&period; It is basically a check for Null value without the presence of the value&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;observer-pattern-design-patterns-java&sol;"><strong>Observer<&sol;strong><&sol;a><br &sol;>&NewLine;A One-to-Many relationship calls for the need of Observer pattern to check the relative dependencies of objects&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;state-pattern&sol;"><strong>State<&sol;strong><&sol;a><br &sol;>&NewLine;In State pattern&comma; the behavior of a class varies with its state and is thus represented by the context object&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;strategy-pattern-design-patterns-java&sol;"><strong>Strategy<&sol;strong><&sol;a><br &sol;>&NewLine;Strategy pattern deals with the change in class behavior at runtime&period; The objects consist of strategies and the context object judges the behavior at runtime of each strategy&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;template-method-pattern-design-java&sol;"><strong>Template method<&sol;strong><&sol;a><br &sol;>&NewLine;It is used with components having similarity where a template of the code may be implemented to test both the components&period; The code can be changed with minor alterations&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;visitor-pattern&sol;"><strong>Visitor<&sol;strong><&sol;a><br &sol;>&NewLine;A Visitor performs a set of operations on an element class and changes its behavior of execution&period; Thus the variance in the behavior of element class is dependent on the change in visitor class&period;<&sol;li>&NewLine;<&sol;ul>&NewLine;<h2>J2EE Patterns<&sol;h2>&NewLine;<p>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; The J2EE patterns deal with testing on the presentation tier as offered by Sun Java Center&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;<p><img class&equals;"aligncenter wp-image-3647 size-full" 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;<p>Happy Design Patterns Learning with us&excl;&excl;&excl;<&sol;p>&NewLine;<&sol;div>&NewLine;<p><&excl;--more--><&sol;p>&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; &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;iterator-pattern-design-patterns-java&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; '694'&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