aspose file tools*
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 Java 8 in Action this week in the Java 8 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: 7081
    
  16

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?
Artlicles by Winston can be found here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Design Query
 
Similar Threads
Declaring and initializing instance variables
Question on casting
java adapter pattern
Implementing multiple interfaces with identical method names !
NX: Remote/IOException in DBServices interface (Ken...?)