Design Pattern

Strategy Pattern Design Patterns in Java

<p><strong>Strategy Pattern<&sol;strong> is one of the <strong><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;behavioral-design-pattern&sol;">behavioral design patterns<&sol;a><&sol;strong>&period; The strategy pattern&comma; in computer programming&comma; is also known as policy pattern&period; It makes it possible to select an algorithm at run-time&period; The strategy pattern is responsible for defining a family of algorithms&comma; encapsulating every algorithm and making the algorithms capable of interchanging themselves within the family of algorithms&period;<&sol;p>&NewLine;<p>The strategy pattern was added in the highly influential book&comma; Design Patterns by Gamma et&period;al&period; This book made popular the concept of design patterns usage in computer programming&semi; object-oriented programming to design&comma; versatile and reusable object-oriented software&period;<&sol;p>&NewLine;<h2>Strategy Pattern<&sol;h2>&NewLine;<div style&equals;"text-align&colon; left&semi;">&NewLine;<blockquote><p><strong>According to the Gang of Four&colon;<&sol;strong><&sol;p>&NewLine;<div style&equals;"text-align&colon; left&semi;">Define a family of algorithms&comma; encapsulate each one&comma; and make them interchangeable&period; Strategy lets the algorithm vary independently from clients that use it&period;<&sol;div>&NewLine;<&sol;blockquote>&NewLine;<&sol;div>&NewLine;<p><strong>For example&comma;<&sol;strong> if a class were to perform a validation on incoming data&comma; it could approach the strategy pattern in order to select a validation algorithm&comma; on account for the type of the data received&comma; the source by which the data was received&comma; the choice of the user or any other differentiating factors&period; These factors are not recognized until run-time and may additionally require completely different validation to be performed&period; It is possible for the different validating objects in the system or even different regions of the system&comma; to be able to use the validation algorithms or strategies because the strategies are encased separately from the validating objects&period; This can be done without having to duplicate the code&period;<&sol;p>&NewLine;<div style&equals;"text-align&colon; left&semi;">&NewLine;<blockquote><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;observer-pattern-design-patterns-java&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;observer-pattern-design-patterns-java&sol;">Observer Design Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;chain-responsibility-pattern&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;chain-responsibility-pattern&sol;">Chain of responsibility Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;command-pattern-design-patterns-java&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;command-pattern-design-patterns-java&sol;">Command Design Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;template-method-pattern-design-java&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;template-method-pattern-design-java&sol;">Template method Design Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;interpreter-pattern-design-patterns-java&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;interpreter-pattern-design-patterns-java&sol;">Interpreter Design Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;iterator-pattern-design-patterns-java&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;iterator-pattern-design-patterns-java&sol;">Iterator Design Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;mediator-pattern-design-patterns-java&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;mediator-pattern-design-patterns-java&sol;">Mediator Design Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;memento-pattern-design-patterns-java&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;memento-pattern-design-patterns-java&sol;">Memento Design Pattern<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;creational-design-patterns&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;creational-design-patterns&sol;&sol;">Creational GoF Design Patterns<&sol;a><&sol;li>&NewLine;<li><a title&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;structural-design-patterns&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;structural-design-patterns&sol;">Structural GoF Design Patterns<&sol;a><&sol;li>&NewLine;<&sol;ul>&NewLine;<&sol;blockquote>&NewLine;<&sol;div>&NewLine;<h2>Implementing the Strategy Pattern<&sol;h2>&NewLine;<p>To implement the strategy pattern&comma; the most important requirement is to be able to hold a reference to the same code in the data structure and be able to retrieve it&period; There are different mechanisms to achieve this&comma; which are&semi; native function pointer&comma; the first class function&comma; by gaining access to the internal storage of the code of implementation language using reflection method&comma; classes or class instances in object-oriented programming&period;<&sol;p>&NewLine;<p>To design&comma; versatile and reusable object-oriented software&comma; there is <strong><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;design-patterns&lowbar;25&sol;">23 well-known Gang of Four &lpar;GoF&rpar; design patterns<&sol;a><&sol;strong>&comma; the strategy behavioral pattern is one of them&period; There are some problems that strategy pattern caters&period; A class is supposed to be configured using an algorithm&comma; it is not supposed to be implementing an algorithm explicitly&period; An algorithm must be chosen and interchanged at a run-time&period; Algorithms are defined as a method or procedure which takes in an input value&comma; operate some operations on the value&comma; perform some steps on it and produces an output value&period; Generally&comma; it is said to be a piece of code which performs appropriate operations&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" 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;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" 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;<&sol;div>&NewLine;<p>To implement an algorithm explicitly in the class which uses the algorithm&comma; it creates inflexibility&comma; because it tightly couples the class to a certain algorithm at compile-time and in turn makes it difficult&comma; almost impossible to alter the algorithm later&comma; without having to alter the class&period; Due to this problem&comma; the class is no longer reusable for any other algorithm that is to be used&period; The strategy pattern is responsible for defining a separate object which encloses an algorithm&comma; which means it defines an interface for executing an algorithm&period; It is also able to define classes which perform the algorithms in various ways&period; A strategy object is assigned an algorithm at run-time by a Class&period;<&sol;p>&NewLine;<h2>Benefits of the Strategy Pattern&colon;<&sol;h2>&NewLine;<p>There are following lists the benefits of using the Strategy pattern&colon;<&sol;p>&NewLine;<ul>&NewLine;<li>This pattern allows you to create the related classes with difference their behavior&period;<&sol;li>&NewLine;<li>This pattern provide a group of interchangable algorithms&period;<&sol;li>&NewLine;<li>It provides an alternate of subclassing<&sol;li>&NewLine;<li>It reduce complexity because it defines each behavior in its own class&comma; so it eliminates conditional statements&period;<&sol;li>&NewLine;<&sol;ul>&NewLine;<h2>UML Class Diagram for Strategy Design Pattern<&sol;h2>&NewLine;<p>Let&&num;8217&semi;s see the following UML diagram is showing the all components of Strategy design pattern&colon;<&sol;p>&NewLine;<p><img class&equals;"aligncenter wp-image-3312 size-full" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2017&sol;12&sol;strategy&period;gif" alt&equals;"Strategy Pattern Design Patterns in Java" width&equals;"437" height&equals;"164" &sol;><&sol;p>&NewLine;<h3>Strategy<&sol;h3>&NewLine;<p>It is an interface&comma; it is common to all strategies or algorithms&comma; Suppose a SortStrategy in the application&period;<&sol;p>&NewLine;<h3>ConcreteStrategy<&sol;h3>&NewLine;<p>It is implementation of Strategy interface&comma; it implements the algorithm using the Strategy&period; Suppose QuickSort&comma; MergeSort etc are implementation of SortStrategy interface&period;<&sol;p>&NewLine;<h3>Context<&sol;h3>&NewLine;<p>It is a class that configured with a ConcreteStrategy object&period; Its behavior depedends on the state of Strategy&period; Suppose if you change QuickSort to MergeSort then behavior of context object changed accordingly as like SortedList&period;<&sol;p>&NewLine;<h2>Example for Strategy Design Pattern Implementation<&sol;h2>&NewLine;<p>This real-world code demonstrates the Strategy pattern which encapsulates sorting algorithms in the form of sorting objects&period; This allows clients to dynamically change sorting strategies including Quicksort&comma; Shellsort&comma; and Mergesort&period;<&sol;p>&NewLine;<h3>Step 1&colon; Create an interface&period;<br &sol;>&NewLine;SortStrategy&period;java<&sol;h3>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;strategy&period;state&semi; &NewLine; &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 interface SortStrategy &lbrace; &NewLine;&Tab; &NewLine;&Tab;void sort&lpar;List list&rpar;&semi; &NewLine;&Tab; &NewLine;&rcub; &NewLine;<&sol;pre>&NewLine;<h3>Step 2&colon; Create concrete classes implementing the same interface&period;<br &sol;>&NewLine;QuickSort&period;java<&sol;h3>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;strategy&period;state&semi; &NewLine; &NewLine;import java&period;util&period;Comparator&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 QuickSort implements SortStrategy &lbrace; &NewLine; &NewLine;&Tab;&commat;Override &NewLine;&Tab;public void sort&lpar;List list&rpar; &lbrace; &NewLine;&Tab;&Tab;&sol;&sol;Implementing quick sort here &NewLine;&Tab;&Tab;list&period;sort&lpar;new Comparator&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;&Tab;&commat;Override &NewLine;&Tab;&Tab;&Tab;public int compare&lpar;String o1&comma; String o2&rpar; &lbrace; &NewLine;&Tab;&Tab;&Tab;&Tab;return o1&period;compareTo&lpar;o2&rpar;&semi; &NewLine;&Tab;&Tab;&Tab;&rcub; &NewLine;&Tab;&Tab;&Tab; &NewLine;&Tab;&Tab;&rcub;&rpar;&semi; &NewLine;&Tab;&Tab;System&period;out&period;println&lpar;"QuickSorted list "&rpar;&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&rcub; &NewLine;<&sol;pre>&NewLine;<h3>MergeSort&period;java<&sol;h3>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;strategy&period;state&semi; &NewLine; &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 MergeSort implements SortStrategy &lbrace; &NewLine; &NewLine;&Tab;&commat;Override &NewLine;&Tab;public void sort&lpar;List list&rpar; &lbrace; &NewLine;&Tab;&Tab;&sol;&sol;Implement merge sort here &NewLine;&Tab;&Tab;System&period;out&period;println&lpar;"MergeSorted list "&rpar;&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>ShellSort&period;java<&sol;h3>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;strategy&period;state&semi; &NewLine; &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 ShellSort implements SortStrategy &lbrace; &NewLine; &NewLine;&Tab;&commat;Override &NewLine;&Tab;public void sort&lpar;List list&rpar; &lbrace; &NewLine;&Tab;&Tab;&sol;&sol;Implement ShellSort Here &NewLine;&Tab;&Tab;System&period;out&period;println&lpar;"ShellSorted list "&rpar;&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 3&colon; Create Context Class&period;<br &sol;>&NewLine;SortedList&period;java<&sol;h3>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;strategy&period;state&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 SortedList &lbrace; &NewLine;&Tab;private List &lowbar;list &equals; new ArrayList&lt&semi;&gt&semi;&lpar;&rpar;&semi; &NewLine; private SortStrategy &lowbar;sortstrategy&semi; &NewLine; &NewLine; public void SetSortStrategy&lpar;SortStrategy sortstrategy&rpar;&lbrace; &NewLine; &Tab;this&period;&lowbar;sortstrategy &equals; sortstrategy&semi; &NewLine; &rcub; &NewLine; &NewLine; public void add&lpar;String name&rpar;&lbrace; &NewLine; &Tab;&lowbar;list&period;add&lpar;name&rpar;&semi; &NewLine; &rcub; &NewLine; &NewLine; public void sort&lpar;&rpar;&lbrace; &NewLine; &Tab;&lowbar;sortstrategy&period;sort&lpar;&lowbar;list&rpar;&semi; &NewLine; &Tab;&sol;&sol; Iterate over list and display results &NewLine; &Tab;for&lpar;String name &colon; &lowbar;list&rpar; &lbrace; &NewLine; &Tab;&Tab;System&period;out&period;println&lpar;" " &plus; name&rpar;&semi; &NewLine; &Tab;&rcub; &NewLine; &Tab;System&period;out&period;println&lpar;&rpar;&semi; &NewLine; &rcub; &NewLine;&rcub; &NewLine;<&sol;pre>&NewLine;<h3>Step 4&colon; Use the Context to see change in behavior when it changes its Strategy&period;<br &sol;>&NewLine;StrategyPatternDemo&period;java<&sol;h3>&NewLine;<pre class&equals;"highlight">&sol;&ast;&ast; &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;package com&period;doj&period;patterns&period;strategy&period;state&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class StrategyPatternDemo &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;&sol;&sol; Two contexts following different strategies &NewLine;&Tab;&Tab;SortedList userRecords &equals; new SortedList&lpar;&rpar;&semi; &NewLine;&Tab;&Tab;userRecords&period;add&lpar;"Dinesh"&rpar;&semi; &NewLine;&Tab;&Tab;userRecords&period;add&lpar;"Arnav"&rpar;&semi; &NewLine;&Tab;&Tab;userRecords&period;add&lpar;"Anamika"&rpar;&semi; &NewLine;&Tab;&Tab;userRecords&period;add&lpar;"Vinesh"&rpar;&semi; &NewLine;&Tab;&Tab;userRecords&period;add&lpar;"Adesh"&rpar;&semi; &NewLine; &NewLine;&Tab;&Tab;userRecords&period;SetSortStrategy&lpar;new QuickSort&lpar;&rpar;&rpar;&semi; &NewLine;&Tab;&Tab;userRecords&period;sort&lpar;&rpar;&semi; &NewLine; &NewLine;&Tab;&Tab;userRecords&period;SetSortStrategy&lpar;new ShellSort&lpar;&rpar;&rpar;&semi; &NewLine;&Tab;&Tab;userRecords&period;sort&lpar;&rpar;&semi; &NewLine; &NewLine;&Tab;&Tab;userRecords&period;SetSortStrategy&lpar;new MergeSort&lpar;&rpar;&rpar;&semi; &NewLine;&Tab;&Tab;userRecords&period;sort&lpar;&rpar;&semi; &NewLine;&Tab;&rcub; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 5&colon; Let&&num;8217&semi;s run the demo class and verify the output&period;<&sol;h3>&NewLine;<pre class&equals;"highlight">QuickSorted list &NewLine; Adesh &NewLine; Anamika &NewLine; Arnav &NewLine; Dinesh &NewLine; Vinesh &NewLine; &NewLine;ShellSorted list &NewLine; Adesh &NewLine; Anamika &NewLine; Arnav &NewLine; Dinesh &NewLine; Vinesh &NewLine; &NewLine;MergeSorted list &NewLine; Adesh &NewLine; Anamika &NewLine; Arnav &NewLine; Dinesh &NewLine; Vinesh &NewLine; &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;state-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;template-method-pattern-design-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; '3311'&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