Design Pattern

Structural design patterns of GoF Family

<p>Structural design patterns that use composition to merge objects and classes into larger structures&period; A good toolbox of structural patterns allows you to solve many thorny problems you are likely to encounter&period; They show you how to glue different pieces of a system together in a flexible and extensible fashion&period; Structural patterns help you guarantee that when one of the parts changes&comma; the entire structure does not need to change&period;<&sol;p>&NewLine;<p>They also show you how to recast pieces that do not fit &lpar;but that you need to use&rpar; into pieces that do fit&period;<br &sol;>&NewLine;In this module&comma; you will learn&colon;<&sol;p>&NewLine;<ul>&NewLine;<li>How programmers use structural patterns<&sol;li>&NewLine;<li>The characteristics of some commonly used structural patterns<&sol;li>&NewLine;<li>When and when not to use the Flyweight pattern<&sol;li>&NewLine;<li>How the Flyweight pattern can help with your course project<&sol;li>&NewLine;<&sol;ul>&NewLine;<div style&equals;"background-color&colon; &num;f2f9fc&semi; border-radius&colon; 3px&semi; border&colon; 1px solid &num;c9e6f2&semi; line-height&colon; 1&period;45&semi; padding&colon; 16px 16px 16px 16px&semi;">&NewLine;<h2 dir&equals;"ltr">Spring 5 Design Pattern Book<&sol;h2>&NewLine;<div dir&equals;"ltr" style&equals;"color&colon; &num;20124d&semi; font-family&colon; 'calibri' &comma; sans-serif&semi; font-size&colon; 13pt&semi; text-align&colon; justify&semi;">You could purchase my <strong>Spring 5 book<&sol;strong> that is with title name &&num;8220&semi;<strong>Spring 5 Design 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;<h2><strong>Types of structural design patterns<&sol;strong><&sol;h2>&NewLine;<p>There are following types of structural design patterns&period;<&sol;p>&NewLine;<p><img class&equals;"aligncenter wp-image-3586 size-full" src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2017&sol;12&sol;Structural-Design-Patterns&period;gif" alt&equals;"Structural Design Patterns" width&equals;"250" height&equals;"245" &sol;><&sol;p>&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;<h3><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;adapter-design-pattern&sol;">Adapter<&sol;a><&sol;h3>&NewLine;<p>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;p>&NewLine;<h3><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;bridge-design-patterns&sol;">Bridge<&sol;a><&sol;h3>&NewLine;<p>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;p>&NewLine;<h3><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;composite-pattern-design-patterns-java&sol;">Composite<&sol;a><&sol;h3>&NewLine;<p>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;p>&NewLine;<h3><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;decorator-design-pattern&sol;">Decorator<&sol;a><&sol;h3>&NewLine;<p>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;p>&NewLine;<h3><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;facade-design-pattern&sol;">Façade<&sol;a><&sol;h3>&NewLine;<p>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;p>&NewLine;<h3><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;flyweight-pattern-design-patterns-java&sol;">Flyweight<&sol;a><&sol;h3>&NewLine;<p>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;p>&NewLine;<h3>Private Class Data<&sol;h3>&NewLine;<p>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;p>&NewLine;<h3><a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;proxy-pattern-design-patterns-java&sol;">Proxy<&sol;a><&sol;h3>&NewLine;<p>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;p>&NewLine;<p>&nbsp&semi;<&sol;p>&NewLine;<p>Happy Learning with us&excl;&excl;&excl;<&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; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;proxy-pattern-design-patterns-java&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;intercepting-filter-design-pattern&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; '3585'&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