Talk:Adapter pattern

message: The Object Adaptor UML looks incorrect to me. Adapter is shown as being derived from Adaptee which is not the case in the GoF book or in the sample Java code. Maybe I'm just misreading the UML, but since the arrow comes from the top and points up into the bottom of the Adaptee box I'm assuming that means inheritance.
--ScottJ 23:21, 24 February 2006 (UTC)
thread_title:  UML incorrect? 

message: if multiple boolean values are stored as a single integer - if this means e.g. a bit vector, the description should mention it.
202.175.118.194 09:29, 28 June 2007 (UTC)
thread_title:  Clear wording 

message: Here's a link I'd like to propose for this page (but as I am its author, I'm not sure whether I should put it up myself):
The Adapter Pattern, DrDobb's Journal, May 8 2007
DDJ usually has nice articles, but I think that one is full of confusing (to me) technicalities.
202.175.118.194 09:33, 28 June 2007 (UTC)
thread_title:  Reference proposal 

message: In the article it says " Class Adapter pattern cannot be used in languages such as Java that do not support multiple inheritance." but the code sample a few lines below is in Java.
You forgot the first part of the sentence: "Note that when the adapter must adapt multiple adaptees". The Java code presents a case where the adapter adapts the DList class to the Stack interface. Emmanuel Deloget 21:00, 30 July 2007 (UTC)
thread_title:  Conflict 

message: The article is wrong. Java does support multiple-inheritance of interfaces, so it's no problem to implement the adapter pattern in Java. Java doesn't support multiple-inheritance of base classes, which is irrelevant to the discussion here.
:One can use an adaptor to effectively inherit from multiple classes in Java though. OrangeDog (talk) 01:06, 28 November 2008 (UTC)
thread_title:  Multiple Inheritance 

message: There's an unmarked section under the Class Adapter definition that explains a process of creating multiple Adapters for converting one value into several others, however I think that this is a far too large / extensive example, and very much aimed at one particular situation - i.e. converting one string value to several other output formats. I believe that this example should either be simplified greatly or removed altogether, or be put in an external link as an example application of the Adapter pattern.
At the very least, I'd like to see the two samples be moved between the example and the two Adapter definitions.
194.109.198.213 (talk) 13:19, 3 March 2009 (UTC)
thread_title:  Odd example under Class Adapter 

message: I just commented the comments in the java code. Maybe I'm just a syntax-NAZI, but it felt wrong to have non-code not commented in the code box. Feel free to revert if you feel that was inappropriate of me. PrometheeFeu (talk)  —Preceding undated comment added 21:00, 6 August 2009 (UTC)
thread_title:  Commenting comments in code 

message: I have shared the following UML diagrams I have published on Design Patterns Open Online Learning. Your comments are welcomed.
In the above UML class diagram, the Client class that requires (depends on) a Target interface can not reuse the Adaptee class directly
because its interface doesn't conform to the Target interface.
Instead, the Client works through an Adapter that implements the Target interface in terms of Adaptee:
The Object Adapter implements the Target interface by delegating to an Adaptee object at run-time (adaptee.specificOperation()).
The Class Adapter implements the Target interface by inheriting from an Adaptee class at compile-time (specificOperation()).
Vanderjoe (talk) 17:53, 28 August 2017 (UTC)
thread_title:  UML class diagram for the Adapter design pattern. 

message: The Ruby example in this article isn't valid syntax. There is no abstract keyword or method, and there is no note that a third party library or framework is in use to implement the abstract interfaces, i.e. the Python example using @abstractmethod decorators from abc. Sj26 (talk) 06:04, 6 June 2018 (UTC)
thread_title:  Invalid Ruby