{"id":76250,"date":"2024-08-21T21:58:45","date_gmt":"2024-08-22T01:58:45","guid":{"rendered":"https:\/\/bangla.sitestree.com\/?p=76250"},"modified":"2024-08-21T21:58:52","modified_gmt":"2024-08-22T01:58:52","slug":"adapter-design-patterns","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=76250","title":{"rendered":"Adapter Design Patterns"},"content":{"rendered":"\n<p><strong><u>Adapter Design Patterns<\/u><\/strong><\/p>\n\n\n\n<p>What is a design pattern?<\/p>\n\n\n\n<p>What is a Structural Design Pattern?<\/p>\n\n\n\n<p>What is an Adapter Design Pattern?<\/p>\n\n\n\n<p>What is the purpose of the Adapter Design Pattern?<\/p>\n\n\n\n<p>What is the category of the Adapter Design Pattern?<\/p>\n\n\n\n<p>Provide use cases where you can use a Adapter design pattern.<\/p>\n\n\n\n<p>How do you implement the Adapter design pattern?<\/p>\n\n\n\n<p>Write example classes to explain Adapter design pattern?<\/p>\n\n\n\n<p><strong>Adapter<\/strong>&nbsp;is a structural design pattern that allows objects with incompatible interfaces to&nbsp;collaborate.<\/p>\n\n\n\n<div class=\"wp-block-media-text is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><\/figure><div class=\"wp-block-media-text__content\">\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"495\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image.png?resize=750%2C495&#038;ssl=1\" alt=\"\" class=\"wp-image-76251\" srcset=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image.png?w=828 828w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image.png?resize=300%2C198 300w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image.png?resize=768%2C507 768w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n<\/div><\/div>\n\n\n\n<p>Ref: A good read:&nbsp;<a href=\"https:\/\/refactoring.guru\/design-patterns\/adapter\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/refactoring.guru\/design-patterns\/adapter<\/a><\/p>\n\n\n\n<div class=\"wp-block-media-text is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><\/figure><div class=\"wp-block-media-text__content\">\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"282\" src=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-1.png?resize=750%2C282&#038;ssl=1\" alt=\"\" class=\"wp-image-76252\" srcset=\"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-1.png?w=975 975w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-1.png?resize=300%2C113 300w, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/08\/image-1.png?resize=768%2C288 768w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n<\/div><\/div>\n\n\n\n<p>Ref: Wikipedia<\/p>\n\n\n\n<p>What is a design pattern?<\/p>\n\n\n\n<p>What is a Structural Design Pattern?<\/p>\n\n\n\n<p>What is an Adapter Design Pattern?<\/p>\n\n\n\n<p>What is the purpose of the Adapter Design Pattern?<\/p>\n\n\n\n<p>What is the category of the Adapter Design Pattern?<\/p>\n\n\n\n<p>Provide use cases where you can use a Adapter design pattern.<\/p>\n\n\n\n<p>How do you implement the Adapter design pattern?<\/p>\n\n\n\n<p>Write example classes to explain Adapter design pattern?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adapter Design Patterns What is a design pattern? What is a Structural Design Pattern? What is an Adapter Design Pattern? What is the purpose of the Adapter Design Pattern? What is the category of the Adapter Design Pattern? Provide use cases where you can use a Adapter design pattern. How do you implement the Adapter &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=76250\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[182],"tags":[],"class_list":["post-76250","post","type-post","status-publish","format-standard","hentry","category---blog","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":76009,"url":"http:\/\/bangla.sitestree.com\/?p=76009","url_meta":{"origin":76250,"position":0},"title":"Java Structural Design Patterns","author":"Sayed","date":"May 6, 2024","format":false,"excerpt":"Adapter Design Patterns Ref: A good read: https:\/\/refactoring.guru\/design-patterns\/adapter Ref: Wikipedia Ref: https:\/\/www.visual-paradigm.com\/guide\/uml-unified-modeling-language\/uml-aggregation-vs-composition\/","rel":"","context":"In &quot;Java Design Patterns and OOP&quot;","block_context":{"text":"Java Design Patterns and OOP","link":"http:\/\/bangla.sitestree.com\/?cat=1962"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/05\/image-7.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":76018,"url":"http:\/\/bangla.sitestree.com\/?p=76018","url_meta":{"origin":76250,"position":1},"title":"Java: Facade Design Pattern","author":"Sayed","date":"May 6, 2024","format":false,"excerpt":"Fa\u00e7ade Pattern \u201cFacade is a structural design pattern that provides a simplified interface to a library, a framework, or any other complex set of classes.\u201d \u201cWhen you call a shop to place a phone order, an operator is your facade to all services and departments of the shop. The operator\u2026","rel":"","context":"In &quot;Java Design Patterns and OOP&quot;","block_context":{"text":"Java Design Patterns and OOP","link":"http:\/\/bangla.sitestree.com\/?cat=1962"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/05\/image-9.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":76014,"url":"http:\/\/bangla.sitestree.com\/?p=76014","url_meta":{"origin":76250,"position":2},"title":"Java : Decorator Design pattern","author":"Sayed","date":"May 6, 2024","format":false,"excerpt":"Decorator Design pattern: Decorator is a structural design pattern that lets you attach new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors. Example: Assume: A notifier class\/object can send only email messages. But the application at a later time may want to use\u2026","rel":"","context":"In &quot;Java Design Patterns and OOP&quot;","block_context":{"text":"Java Design Patterns and OOP","link":"http:\/\/bangla.sitestree.com\/?cat=1962"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/05\/image-8.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/05\/image-8.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/05\/image-8.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/05\/image-8.png?resize=700%2C400 2x"},"classes":[]},{"id":78393,"url":"http:\/\/bangla.sitestree.com\/?p=78393","url_meta":{"origin":76250,"position":3},"title":"Java Design Patterns Simplified","author":"Sayed","date":"August 24, 2025","format":false,"excerpt":"From AI Tools\/OpenAI\/Internet \" Here\u2019s a short, copyright-free version suitable for Facebook or a blog post: Java Design Patterns Simplified Design patterns are proven solutions to common programming problems. They make code more reusable, flexible, and easier to maintain. 1\ufe0f\u20e3 Creational Patterns \u2013 How objects are created.Examples: Singleton, Factory, Builder,\u2026","rel":"","context":"In &quot;Anything JAVA&quot;","block_context":{"text":"Anything JAVA","link":"http:\/\/bangla.sitestree.com\/?cat=1975"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76023,"url":"http:\/\/bangla.sitestree.com\/?p=76023","url_meta":{"origin":76250,"position":4},"title":"Proxy Pattern","author":"Sayed","date":"May 6, 2024","format":false,"excerpt":"Proxy Pattern: \u201cProxy is a structural design pattern that lets you provide a substitute or placeholder for another object. A proxy controls access to the original object, allowing you to perform something either before or after the request gets through to the original object.\u201d \u201cA credit card is a proxy\u2026","rel":"","context":"In &quot;Java Design Patterns and OOP&quot;","block_context":{"text":"Java Design Patterns and OOP","link":"http:\/\/bangla.sitestree.com\/?cat=1962"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2024\/05\/image-13.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":78099,"url":"http:\/\/bangla.sitestree.com\/?p=78099","url_meta":{"origin":76250,"position":5},"title":"Java Creational Design Patterns","author":"Sayed","date":"May 4, 2025","format":false,"excerpt":"5 types of creational design patterns: Factory Design Patterns: Purpose: Create Objects, Keep Object Creation Centralized Abstract Factory Design Patterns Singleton Design Pattern: Limit instantiation\u00a0 of a clas to only one instance Prototype Design Patterns: Object creation based on Prototype Object Instance; Simpler Object Creation than Factory. Builder Design Patterns:\u2026","rel":"","context":"In &quot;Root&quot;","block_context":{"text":"Root","link":"http:\/\/bangla.sitestree.com\/?cat=1"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-3.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-3.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-3.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/05\/image-3.png?resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76250"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76250\/revisions"}],"predecessor-version":[{"id":76253,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76250\/revisions\/76253"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76250"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}