This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Design Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Design Query" Watch "Design Query" New topic
Author

Design Query

Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

Is it good idea to implement Adapter pattern if both Client interface and adaptee has same return type but the only difference is that adaptee return the array of that object? Can we implement it using Adapter?


http://muhammadkhojaye.blogspot.com/
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7892
    
  21

Muhammad Khojaye wrote:Is it good idea to implement Adapter pattern if both Client interface and adaptee has same return type but the only difference is that adaptee return the array of that object? Can we implement it using Adapter?

I think you'll have to provide more information than that.

An example might help, or simply an explanation of what you're trying to do.

Also: If something needs to return an array, isn't it already a collection of some kind?

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
jQuery in Action, 2nd edition
 
subject: Design Query