<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Adapter on Java &amp; Software Architecture Knowledge Hub</title><link>https://samirsahoo.github.io/design-patterns-hub/tags/adapter/</link><description>Recent content in Adapter on Java &amp; Software Architecture Knowledge Hub</description><generator>Hugo</generator><language>en-US</language><copyright>© 2026 Samir Kumar Sahoo (https://github.com/samirsahoo). All rights reserved.</copyright><atom:link href="https://samirsahoo.github.io/design-patterns-hub/tags/adapter/index.xml" rel="self" type="application/rss+xml"/><item><title>Adapter vs Decorator vs Proxy vs Facade</title><link>https://samirsahoo.github.io/design-patterns-hub/comparisons/adapter-decorator-proxy-facade/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/comparisons/adapter-decorator-proxy-facade/</guid><description>&lt;h2 id="the-deciding-question"&gt;The deciding question&lt;a class="heading-anchor" href="#the-deciding-question" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;All four patterns put an object in front of another object. They differ in &lt;strong&gt;why&lt;/strong&gt;:&lt;/p&gt;&#10;&lt;div class="table-wrap" tabindex="0" role="region" aria-label="Table"&gt;&#10;&lt;table&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th&gt;Pattern&lt;/th&gt;&#10; &lt;th&gt;The wrapper exists to…&lt;/th&gt;&#10; &lt;th&gt;Interface towards the client&lt;/th&gt;&#10; &lt;th&gt;Wraps&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;strong&gt;Adapter&lt;/strong&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;em&gt;translate&lt;/em&gt; an incompatible interface&lt;/td&gt;&#10; &lt;td&gt;&lt;strong&gt;Different&lt;/strong&gt; from the wrapped object&amp;rsquo;s&lt;/td&gt;&#10; &lt;td&gt;One object&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;strong&gt;Decorator&lt;/strong&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;em&gt;add&lt;/em&gt; behaviour while keeping the interface&lt;/td&gt;&#10; &lt;td&gt;&lt;strong&gt;Same&lt;/strong&gt; as the wrapped object&amp;rsquo;s&lt;/td&gt;&#10; &lt;td&gt;One object (stackable)&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;strong&gt;Proxy&lt;/strong&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;em&gt;control access&lt;/em&gt; to the real object&lt;/td&gt;&#10; &lt;td&gt;&lt;strong&gt;Same&lt;/strong&gt; as the real object&amp;rsquo;s&lt;/td&gt;&#10; &lt;td&gt;One object&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;strong&gt;Facade&lt;/strong&gt;&lt;/td&gt;&#10; &lt;td&gt;&lt;em&gt;simplify&lt;/em&gt; a complex subsystem&lt;/td&gt;&#10; &lt;td&gt;&lt;strong&gt;New&lt;/strong&gt;, simpler interface&lt;/td&gt;&#10; &lt;td&gt;Many objects&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;aside class="callout callout--key" role="note"&gt;&#10; &lt;p class="callout__title"&gt;&lt;span class="callout__label"&gt;Key concept&lt;/span&gt;&lt;span class="callout__heading"&gt;Ask two questions&lt;/span&gt;&lt;/p&gt;&#10; &lt;div class="callout__body"&gt;&lt;ol&gt;&#10;&lt;li&gt;Does the client see the &lt;strong&gt;same interface&lt;/strong&gt; as the wrapped object? If not, it is an Adapter or a Facade.&lt;/li&gt;&#10;&lt;li&gt;Is the purpose to &lt;strong&gt;add behaviour&lt;/strong&gt; (Decorator), &lt;strong&gt;control access&lt;/strong&gt; (Proxy), &lt;strong&gt;translate&lt;/strong&gt; (Adapter) or &lt;strong&gt;simplify&lt;/strong&gt; (Facade)?&lt;/li&gt;&#10;&lt;/ol&gt;&lt;/div&gt;&#10;&lt;/aside&gt;</description></item><item><title>Adapter Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/structural/adapter/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/structural/adapter/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;The &lt;strong&gt;Adapter&lt;/strong&gt; pattern lets code work with a class whose interface does not match what the code expects. The adapter implements the interface the client wants and translates every call into the interface the existing class provides.&lt;/p&gt;</description></item></channel></rss>