Hi Rob,
I think you are confusing the Adapter Pattern with the Composition Pattern.
I think everything you said above is better applied to the Composition Pattern once you have a scenario where one class wrappers another class to add some functionality. (If I did not misunderstand you of course!)
Think about the java.io classes : BufferedWriter takes in its constructor a FileWriter which in turn takes in its constructor a File class.
BufferedWriter = new BufferedWriter(new FileWriter(new File("myfile.txt")));
If you have in your app the scenario I explained above, for sure you are using the Composition Pattern instead of Adapter Pattern.
On the other hand, the Adapter Pattern is for those situations where you want to convert a class reference for another class type expected by your program and that is not on the same class hierarchy of the class being converted.
This pattern does not add functionality at all. It only changes some class interface to another identical interface always maintaing the same functionalities.
Example :
Supposing you have the following class
Sometimes we can get confused with the Composition Pattern because of the wrapped properties needed to implement the Adapter class, in this case the private generalDuck property. But the key point here is : No functionality was added.
Did you get the point ?
I think anyone else can give us a better explanation but I think I'm on the right track.
Best Regards.
[ September 05, 2006: Message edited by: Edisandro Bessa ]