This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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


Win a copy of Android Security Essentials Live Lessons this week in the Android 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: 7549
    
  18

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Design Query
 
Similar Threads
NX: Remote/IOException in DBServices interface (Ken...?)
java adapter pattern
Declaring and initializing instance variables
Implementing multiple interfaces with identical method names !
Question on casting