Design Pattern

Memento Pattern Design Patterns in java

<p><strong>The memento pattern<&sol;strong> comes under <strong><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;behavioral-design-pattern&sol;">the behavioral patterns<&sol;a><&sol;strong> in object-oriented programming&period; In the memento pattern&comma; the object is given the facility to restore its preceding state&period; The three objects include&comma; the originator&comma; a caretaker plus a memento object&comma; are required to implement memento pattern&period;<&sol;p>&NewLine;<p>The internal state is stored in the originator object&period; The caretaker object performs an operation on the originator&semi; however it requires to be able to undo changes that occur to the originator&period; The caretaker object requests the originator object for the memento object first&comma; and then it performs the operations or the sequence of the operations on the originator&period; To go back to the previous state&comma; the caretaker returns this memento object back to the Originator object&period; Hence&comma; the object of memento is unable to be altered by the caretaker object&period; It is an opaque object&period; The memento pattern can only be applied to a singular object&comma; so if the caretaker object changes other objects&comma; a special attention is required&period;<&sol;p>&NewLine;<h2>The Memento 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;">Without violating encapsulation&comma; capture and externalize an object&&num;8217&semi;s internal state so that the object can be restored to this state later&period;<&sol;div>&NewLine;<&sol;blockquote>&NewLine;<&sol;div>&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 memento pattern is one of them&period; There are some problems that memento pattern caters&period; The internal state of the object is supposed to be stored externally so that when it comes to restoration of the object&comma; this externally stored&comma; internal state can be used&period; The encapsulation of the object should not be violated&period; The object needs to be encapsulated because the data structure &lpar;representation&rpar; of the object is stored inside it&comma; which cannot be and should not be accessed from outside of the object&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;strategy-pattern-design-patterns-java&sol;" href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;strategy-pattern-design-patterns-java&sol;">Strategy 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;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;<p>The pattern defines an object&comma; the originator object that saves the internal state of the objects in a memento object and restores the object to its previous state using a memento object&period; The memento can only be accessed by the originator object that created it in the first place&period; The caretaker object requests the originator for a memento object&comma; in which it stores the object’s internal state and then return that memento object back to the originator&comma; in order to restore the object’s previous state&period; This way&comma; the originator can be saved and restored without having to violate its encapsulation&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 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;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>The memento object is capable of storing the internal state of the Originator object&period; The state may include a number of state variables&period; The memento object must store two interfaces&period; The interface to the caretaker and the interface to the originator object&period; This interface to the caretaker is not supposed to allow any operations to be performed or any access to the internal state&comma; which is stored by the memento&comma; which honors the encapsulation&period;<&sol;p>&NewLine;<p>The interface to the originator is supposed to allow the originator object to be able to access any state variables which are required by the originator to restore the previous state&period; The originator object is capable of creating a memento object&comma; which stores the internal state of the originator&period; It also uses the memento object to restore its previous state&period; The caretaker object is supposed to keep the memento object but is not allowed to access or operate on the memento object&period;<&sol;p>&NewLine;<h2>UML class Diagram of this Pattern<&sol;h2>&NewLine;<p>Let&&num;8217&semi;s see the following class diagram of the Memento Design Pattern and its component classes&period;<&sol;p>&NewLine;<p><img class&equals;"aligncenter wp-image-3472 size-full" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2017&sol;12&sol;memento&period;gif" alt&equals;"Memento Pattern Design Patterns in Java" width&equals;"442" height&equals;"157" &sol;><&sol;p>&NewLine;<h3>Memento&colon;<&sol;h3>&NewLine;<p>It stores internal state of the Originator object&period;<&sol;p>&NewLine;<h3>Originator&colon;<&sol;h3>&NewLine;<p>It creates a memento containing a snapshot of its current internal state&period;<&sol;p>&NewLine;<h3>Caretaker&colon;<&sol;h3>&NewLine;<p>It is responsible for the memento&&num;8217&semi;s safekeeping&period;<&sol;p>&NewLine;<h2>Sample Example for Memento Design Pattern<&sol;h2>&NewLine;<p>Let&&num;8217&semi;s see the following real world example for this pattern&period; This real-world code demonstrates the Memento pattern which temporarily saves and then restores the SalesProspect&&num;8217&semi;s internal state&period;<&sol;p>&NewLine;<h3>Step 1&colon; Create Memento class&period;<br &sol;>&NewLine;Memento&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;behavior&period;momento&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class Memento &lbrace; &NewLine;&Tab; &NewLine;&Tab; private String &lowbar;name&semi; &NewLine; &NewLine;&Tab; private String &lowbar;phone&semi; &NewLine; &NewLine;&Tab; private double &lowbar;budget&semi; &NewLine; &NewLine;&Tab;public Memento&lpar;String &lowbar;name&comma; String &lowbar;phone&comma; double &lowbar;budget&rpar; &lbrace; &NewLine;&Tab;&Tab;super&lpar;&rpar;&semi; &NewLine;&Tab;&Tab;this&period;&lowbar;name &equals; &lowbar;name&semi; &NewLine;&Tab;&Tab;this&period;&lowbar;phone &equals; &lowbar;phone&semi; &NewLine;&Tab;&Tab;this&period;&lowbar;budget &equals; &lowbar;budget&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public String get&lowbar;name&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;return &lowbar;name&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public void set&lowbar;name&lpar;String &lowbar;name&rpar; &lbrace; &NewLine;&Tab;&Tab;this&period;&lowbar;name &equals; &lowbar;name&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public String get&lowbar;phone&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;return &lowbar;phone&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public void set&lowbar;phone&lpar;String &lowbar;phone&rpar; &lbrace; &NewLine;&Tab;&Tab;this&period;&lowbar;phone &equals; &lowbar;phone&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public double get&lowbar;budget&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;return &lowbar;budget&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public void set&lowbar;budget&lpar;double &lowbar;budget&rpar; &lbrace; &NewLine;&Tab;&Tab;this&period;&lowbar;budget &equals; &lowbar;budget&semi; &NewLine;&Tab;&rcub; &NewLine;&Tab; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 2&colon; Create Originator class<br &sol;>&NewLine;SalesProspect&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;behavior&period;momento&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class SalesProspect &lbrace; &NewLine;&Tab; &NewLine; private String &lowbar;name&semi; &NewLine; &NewLine; private String &lowbar;phone&semi; &NewLine; &NewLine; private double &lowbar;budget&semi; &NewLine; &NewLine;&Tab;public String get&lowbar;name&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;return &lowbar;name&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public void set&lowbar;name&lpar;String &lowbar;name&rpar; &lbrace; &NewLine;&Tab;&Tab;this&period;&lowbar;name &equals; &lowbar;name&semi; &NewLine;&Tab;&Tab;System&period;out&period;println&lpar;"Name&colon; " &plus; &lowbar;name&rpar;&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public String get&lowbar;phone&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;return &lowbar;phone&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public void set&lowbar;phone&lpar;String &lowbar;phone&rpar; &lbrace; &NewLine;&Tab;&Tab;this&period;&lowbar;phone &equals; &lowbar;phone&semi; &NewLine;&Tab;&Tab;System&period;out&period;println&lpar;"Phone&colon; " &plus; &lowbar;phone&rpar;&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public double get&lowbar;budget&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;return &lowbar;budget&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public void set&lowbar;budget&lpar;double &lowbar;budget&rpar; &lbrace; &NewLine;&Tab;&Tab;this&period;&lowbar;budget &equals; &lowbar;budget&semi; &NewLine;&Tab;&Tab;System&period;out&period;println&lpar;"Budget&colon; " &plus; &lowbar;budget&rpar;&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;&sol;&sol; Stores memento &NewLine; public Memento saveMemento&lpar;&rpar;&lbrace; &NewLine; &Tab;System&period;out&period;println&lpar;&rpar;&semi; &NewLine; &Tab;System&period;out&period;println&lpar;"Saving state --"&rpar;&semi; &NewLine; &Tab;System&period;out&period;println&lpar;&rpar;&semi; &NewLine; &Tab;return new Memento&lpar;&lowbar;name&comma; &lowbar;phone&comma; &lowbar;budget&rpar;&semi; &NewLine; &rcub; &NewLine; &NewLine; &sol;&sol; Restores memento &NewLine; public void restoreMemento&lpar;Memento memento&rpar;&lbrace; &NewLine; &Tab;System&period;out&period;println&lpar;&rpar;&semi; &NewLine; &Tab;System&period;out&period;println&lpar;"Restoring state --"&rpar;&semi; &NewLine; &Tab;System&period;out&period;println&lpar;&rpar;&semi; &NewLine; &Tab;this&period;set&lowbar;name&lpar;memento&period;get&lowbar;name&lpar;&rpar;&rpar;&semi; &NewLine; &Tab;this&period;set&lowbar;phone&lpar;memento&period;get&lowbar;phone&lpar;&rpar;&rpar;&semi; &NewLine; &Tab;this&period;set&lowbar;budget&lpar;memento&period;get&lowbar;budget&lpar;&rpar;&rpar;&semi; &NewLine; &rcub; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 3&colon; Create CareTaker class<br &sol;>&NewLine;ProspectMemory&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;behavior&period;momento&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class ProspectMemory &lbrace; &NewLine;&Tab; &NewLine;&Tab;private Memento &lowbar;memento&semi; &NewLine; &NewLine;&Tab;public Memento get&lowbar;memento&lpar;&rpar; &lbrace; &NewLine;&Tab;&Tab;return &lowbar;memento&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&Tab;public void set&lowbar;memento&lpar;Memento &lowbar;memento&rpar; &lbrace; &NewLine;&Tab;&Tab;this&period;&lowbar;memento &equals; &lowbar;memento&semi; &NewLine;&Tab;&rcub; &NewLine;&Tab; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 4&colon; Use CareTaker and Originator objects&period;<br &sol;>&NewLine;MementoPatternDemo&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;behavior&period;momento&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh&period;Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class MementoPatternDemo &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;SalesProspect salesProspect &equals; new SalesProspect&lpar;&rpar;&semi; &NewLine;&Tab;&Tab;salesProspect&period;set&lowbar;name&lpar;"Dinesh Rajput"&rpar;&semi; &NewLine;&Tab;&Tab;salesProspect&period;set&lowbar;phone&lpar;"4482-133-111"&rpar;&semi; &NewLine;&Tab;&Tab;salesProspect&period;set&lowbar;budget&lpar;25000&period;0&rpar;&semi; &NewLine; &NewLine;&Tab;&Tab;&sol;&sol; Store internal state &NewLine;&Tab;&Tab;ProspectMemory prospectMemory &equals; new ProspectMemory&lpar;&rpar;&semi; &NewLine;&Tab;&Tab;prospectMemory&period;set&lowbar;memento&lpar;salesProspect&period;saveMemento&lpar;&rpar;&rpar;&semi; &NewLine; &NewLine;&Tab;&Tab;&sol;&sol; Continue changing originator &NewLine;&Tab;&Tab;salesProspect&period;set&lowbar;name&lpar;"Arnav Rajput"&rpar;&semi; &NewLine;&Tab;&Tab;salesProspect&period;set&lowbar;phone&lpar;"6682-122-111"&rpar;&semi; &NewLine;&Tab;&Tab;salesProspect&period;set&lowbar;budget&lpar;1000000&period;0&rpar;&semi; &NewLine; &NewLine;&Tab;&Tab;&sol;&sol; Restore saved state &NewLine;&Tab;&Tab;salesProspect&period;restoreMemento&lpar;prospectMemory&period;get&lowbar;memento&lpar;&rpar;&rpar;&semi; &NewLine;&Tab;&rcub; &NewLine; &NewLine;&rcub; &NewLine; &NewLine;<&sol;pre>&NewLine;<h3>Step 5&colon; Let&&num;8217&semi;s run this demo class and verify the output&period;<&sol;h3>&NewLine;<pre class&equals;"highlight">Name&colon; Dinesh Rajput &NewLine;Phone&colon; 4482-133-111 &NewLine;Budget&colon; 25000&period;0 &NewLine; &NewLine;Saving state -- &NewLine; &NewLine;Name&colon; Arnav Rajput &NewLine;Phone&colon; 6682-122-111 &NewLine;Budget&colon; 1000000&period;0 &NewLine; &NewLine;Restoring state -- &NewLine; &NewLine;Name&colon; Dinesh Rajput &NewLine;Phone&colon; 4482-133-111 &NewLine;Budget&colon; 25000&period;0 &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;visitor-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;interpreter-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; '3471'&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