Design Pattern

Service Locator Pattern – Core J2EE Patterns

<p>The design pattern&comma; <strong>Service Locator<&sol;strong> is an important part in software development and it is <strong><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;core-j2ee-patterns-best-design-practices&sol;">core J2EE Design Patterns<&sol;a><&sol;strong>&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; When it is required to locate a number of services&comma; through JNDI lookup&comma; the service locator pattern is used&period;<&sol;p>&NewLine;<h2>Service Locator Pattern<&sol;h2>&NewLine;<p>The service locator pattern uses caching techniques in order to lookup JNDI for a certain service&period; This way&comma; it reduces the overall looking up cost&period; When a service is needed to be looked up firstly&comma; the service locator rummages in the JNDI&period; Then&comma; then it catches the object&period; The lookups for services &lpar;or the same service&rpar; in the future is done by Service Locator in the cache&period; It ultimately enhances the working of the application&period;<&sol;p>&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;<h2>UML Class Diagram for Service Locator<&sol;h2>&NewLine;<p>Let&&num;8217&semi;s see the following class diagram for the Service Locator Pattern&period;<&sol;p>&NewLine;<p><img class&equals;"aligncenter size-full wp-image-4054" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2018&sol;01&sol;Service-Locator&period;gif" alt&equals;"Service Locator" width&equals;"490" height&equals;"374" &sol;><&sol;p>&NewLine;<p>Use a Service Locator to implement and encapsulate service and component lookup&period; A Service Locator hides the implementation details of the lookup mechanism and encapsulates related dependencies&period;<&sol;p>&NewLine;<div style&equals;"text-align&colon; left&semi;">&NewLine;<blockquote>&NewLine;<p><strong>also read&colon;<&sol;strong><&sol;p>&NewLine;<ul style&equals;"text-align&colon; left&semi;">&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;business-delegate&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;business-delegate&sol;">Business Delegate Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;session-facade&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;session-facade&sol;">Session Facade Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;business-object&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;business-object&sol;">Business Object Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;composite-entity-pattern&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;composite-entity-pattern&sol;">Composite Entity Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;transfer-object&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;transfer-object&sol;">Transfer Object Pattern<&sol;a><&sol;li>&NewLine;<&sol;ul>&NewLine;<&sol;blockquote>&NewLine;<&sol;div>&NewLine;<p>There are certain entities involved in the service locator design pattern&semi; <em>service<&sol;em>&comma; <em>context or initial context&comma;<&sol;em> <em>service<&sol;em> <em>locator<&sol;em>&comma; <em>cache<&sol;em>&comma; and <em>client<&sol;em>&period;<&sol;p>&NewLine;<ul>&NewLine;<li><strong>Service<&sol;strong>&&num;8211&semi; The service object is responsible for storing the original service which is going to start working on the request&period; The reference to the required service is looked up in JNDI server&period;<&sol;li>&NewLine;<li><strong>Initial Context<&sol;strong> &&num;8211&semi; The initial context object is responsible for storing the reference of the service that it uses in order to lookup&period;<&sol;li>&NewLine;<li><strong>Service Locator<&sol;strong> &&num;8211&semi; The service locator object is the only point of communication in order to avail services through JNDI lookup which caches the services&period;<&sol;li>&NewLine;<li><strong>Cache<&sol;strong> &&num;8211&semi; The cache object is responsible for storing the references to the services in order to re-utilize them later&period;<&sol;li>&NewLine;<li><strong>Client<&sol;strong> &&num;8211&semi; The client object is responsible for invoking the service requests through the service locator&period;<&sol;li>&NewLine;<&sol;ul>&NewLine;<p>The service locator pattern adds the code during the runtime&comma; the app does not need to be recompiled&period; In some cases&comma; you don’t even need to restart is&period;<&sol;p>&NewLine;<h2>Sample Implementation for Service Locator Design Pattern<&sol;h2>&NewLine;<p>Let&&num;8217&semi;s see the following example for implementation of the Service Locator Design Pattern&period;<&sol;p>&NewLine;<h3>Step 1&colon; Let&&num;8217&semi;s create Service interface for a Business Service&period;<&sol;h3>&NewLine;<p><strong>BusinessService&period;java<&sol;strong><&sol;p>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;j2ee&period;servicelocator&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public interface BusinessService &lbrace; &NewLine;&Tab; &NewLine;&Tab;public String getServiceName&lpar;&rpar;&semi; &NewLine;&Tab; &NewLine;&Tab;public void executeService&lpar;&rpar;&semi; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 2&colon; Let&&num;8217&semi;s create concrete classes for the business services i&period;e&period; Operation Business Service and Client Business Service&period;<&sol;h3>&NewLine;<p><strong>OperationBusinessService&period;java<&sol;strong><&sol;p>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;j2ee&period;servicelocator&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class OperationBusinessService implements BusinessService &lbrace; &NewLine; &NewLine;&Tab;&commat;Override &NewLine;&Tab;public String getServiceName&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;return "Operation"&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;&commat;Override &NewLine;&Tab;public void executeService&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;System&period;out&period;println&lpar;"Executing Business Service for Operation Team"&rpar;&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<p><strong>ClientBusinessService&period;java<&sol;strong><&sol;p>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;j2ee&period;servicelocator&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class ClientBusinessService implements BusinessService &lbrace; &NewLine; &NewLine;&Tab;&commat;Override &NewLine;&Tab;public String getServiceName&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;return "Client"&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;&commat;Override &NewLine;&Tab;public void executeService&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;System&period;out&period;println&lpar;"Executing Business Service for Client"&rpar;&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 3&colon; Let&&num;8217&semi;s create a context class i&period;e&period; InitialContext for JNDI lookup<&sol;h3>&NewLine;<p><strong>InitialContext&period;java<&sol;strong><&sol;p>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;j2ee&period;servicelocator&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class InitialContext &lbrace; &NewLine;&Tab; &NewLine;&Tab;public Object lookup&lpar;String jndiName&rpar;&lbrace; &NewLine;&Tab;&Tab; &NewLine;&Tab;&Tab;if&lpar;jndiName&period;equalsIgnoreCase&lpar;"OPERATION"&rpar;&rpar;&lbrace; &NewLine;&Tab;&Tab;&Tab;System&period;out&period;println&lpar;"Looking up and creating a new OperationBusinessService object"&rpar;&semi; &NewLine;&Tab;&Tab;&Tab;return new OperationBusinessService&lpar;&rpar;&semi; &NewLine;&Tab;&Tab;&rcub;else if &lpar;jndiName&period;equalsIgnoreCase&lpar;"CLIENT"&rpar;&rpar;&lbrace; &NewLine;&Tab;&Tab;&Tab;System&period;out&period;println&lpar;"Looking up and creating a new ClientBusinessService object"&rpar;&semi; &NewLine;&Tab;&Tab;&Tab;return new ClientBusinessService&lpar;&rpar;&semi; &NewLine;&Tab;&Tab;&rcub; &NewLine;&Tab;&Tab;return null&semi;&Tab;&Tab;&Tab; &NewLine;&Tab;&rcub; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 4&colon; Let&&num;8217&semi;s create a services cache class&period;<&sol;h3>&NewLine;<p><strong>ServicesCache&period;java<&sol;strong><&sol;p>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;j2ee&period;servicelocator&semi; &NewLine; &NewLine;import java&period;util&period;ArrayList&semi; &NewLine;import java&period;util&period;List&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class ServicesCache &lbrace; &NewLine;&Tab; &NewLine;&Tab;private List businessServices&semi; &NewLine; &NewLine;&Tab;public ServicesCache&lpar;&rpar;&lbrace; &NewLine;&Tab;&Tab;businessServices &equals; new ArrayList&lt&semi;&gt&semi;&lpar;&rpar;&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public BusinessService getBusinessService&lpar;String serviceName&rpar;&lbrace; &NewLine;&Tab; &NewLine;&Tab;&Tab;for &lpar;BusinessService businessService &colon; businessServices&rpar; &lbrace; &NewLine;&Tab;&Tab;&Tab;if&lpar;businessService&period;getServiceName&lpar;&rpar;&period;equalsIgnoreCase&lpar;serviceName&rpar;&rpar;&lbrace; &NewLine;&Tab;&Tab;&Tab;&Tab;System&period;out&period;println&lpar;"Returning cached " &plus; serviceName &plus; " object"&rpar;&semi; &NewLine;&Tab;&Tab;&Tab;&Tab;return businessService&semi; &NewLine;&Tab;&Tab;&Tab;&rcub; &NewLine;&Tab;&Tab;&rcub; &NewLine;&Tab;&Tab;return null&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public void addBusinessService&lpar;BusinessService newBusinessService&rpar;&lbrace; &NewLine;&Tab;&Tab;boolean exists &equals; false&semi; &NewLine;&Tab; &NewLine;&Tab;&Tab;for &lpar;BusinessService businessService &colon; businessServices&rpar; &lbrace; &NewLine;&Tab;&Tab;&Tab;if&lpar;businessService&period;getServiceName&lpar;&rpar;&period;equalsIgnoreCase&lpar;newBusinessService&period;getServiceName&lpar;&rpar;&rpar;&rpar;&lbrace; &NewLine;&Tab;&Tab;&Tab;&Tab;exists &equals; true&semi; &NewLine;&Tab; &rcub; &NewLine;&Tab;&Tab;&rcub; &NewLine;&Tab;&Tab;if&lpar;&excl;exists&rpar;&lbrace; &NewLine;&Tab;&Tab;&Tab;businessServices&period;add&lpar;newBusinessService&rpar;&semi; &NewLine;&Tab;&Tab;&rcub; &NewLine;&Tab;&rcub; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 5&colon; Let&&num;8217&semi;s create Service Locator<&sol;h3>&NewLine;<p><strong>ServiceLocator&period;java<&sol;strong><&sol;p>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;j2ee&period;servicelocator&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class ServiceLocator &lbrace; &NewLine;&Tab; &NewLine;&Tab;private static ServicesCache servicesCache&semi; &NewLine; &NewLine;&Tab; static &lbrace; &NewLine;&Tab;&Tab; servicesCache &equals; new ServicesCache&lpar;&rpar;&semi;&Tab;&Tab; &NewLine;&Tab; &rcub; &NewLine; &NewLine;&Tab; public static BusinessService getBusinessService&lpar;String jndiName&rpar;&lbrace; &NewLine; &NewLine;&Tab;&Tab; BusinessService businessService &equals; servicesCache&period;getBusinessService&lpar;jndiName&rpar;&semi; &NewLine; &NewLine;&Tab; if&lpar;businessService &excl;&equals; null&rpar;&lbrace; &NewLine;&Tab; return businessService&semi; &NewLine;&Tab; &rcub; &NewLine; &NewLine;&Tab; InitialContext context &equals; new InitialContext&lpar;&rpar;&semi; &NewLine;&Tab; BusinessService businessService2 &equals; &lpar;BusinessService&rpar;context&period;lookup&lpar;jndiName&rpar;&semi; &NewLine;&Tab; servicesCache&period;addBusinessService&lpar;businessService2&rpar;&semi; &NewLine;&Tab; return businessService2&semi; &NewLine;&Tab; &rcub; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 6&colon; Let&&num;8217&semi;s create a demo class that use ServiceLocator to demonstrate Service Locator Design Pattern&period;<&sol;h3>&NewLine;<p><strong>ServiceLocatorPatternDemo&period;java<&sol;strong><&sol;p>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;j2ee&period;servicelocator&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class ServiceLocatorPatternDemo &lbrace; &NewLine; &NewLine;&Tab;&sol;&ast;&ast; &NewLine;&Tab; &ast; &commat;param args &NewLine;&Tab; &ast;&sol; &NewLine;&Tab;public static void main&lpar;String&lbrack;&rsqb; args&rpar; &lbrace; &NewLine;&Tab;&Tab;BusinessService businessService &equals; ServiceLocator&period;getBusinessService&lpar;"OPERATION"&rpar;&semi; &NewLine;&Tab;&Tab;businessService&period;executeService&lpar;&rpar;&semi; &NewLine;&Tab;&Tab;businessService &equals; ServiceLocator&period;getBusinessService&lpar;"CLIENT"&rpar;&semi; &NewLine;&Tab;&Tab;businessService&period;executeService&lpar;&rpar;&semi; &NewLine;&Tab;&Tab;businessService &equals; ServiceLocator&period;getBusinessService&lpar;"OPERATION"&rpar;&semi; &NewLine;&Tab;&Tab;businessService&period;executeService&lpar;&rpar;&semi; &NewLine;&Tab;&Tab;businessService &equals; ServiceLocator&period;getBusinessService&lpar;"CLIENT"&rpar;&semi; &NewLine;&Tab;&Tab;businessService&period;executeService&lpar;&rpar;&semi;&Tab; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 7&colon; Let&&num;8217&semi;s run this demo class and verify the output&period;<&sol;h3>&NewLine;<pre class&equals;"highlight">Looking up and creating a new OperationBusinessService object &NewLine;Executing Business Service for Operation Team &NewLine;Looking up and creating a new ClientBusinessService object &NewLine;Executing Business Service for Client &NewLine;Returning cached OPERATION object &NewLine;Executing Business Service for Operation Team &NewLine;Returning cached CLIENT object &NewLine;Executing Business Service for Client &NewLine; &NewLine;<&sol;pre>&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;business-delegate&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;session-facade&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; '4053'&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