wood burning stoves*
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
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: 8052
    
  22

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Design Query