jQuery in Action, 3rd edition
The moose likes OO, Patterns, UML and Refactoring and the fly likes Adapter pattern question at an interview Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Adapter pattern question at an interview" Watch "Adapter pattern question at an interview" New topic

Adapter pattern question at an interview

divya kundapur
Ranch Hand

Joined: Aug 21, 2007
Posts: 110

I was asked to mention any design patterns used in the project, so i told adapter pattern is used to make 2 different systems work together.

Eg: I have two systems with different object structures , so i used adapter pattern there to make these 2 systems work together.

But the interviewer was not happy with it. Can anybody please let me know whats worng here.

SCJP - 5.0
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Sounds good to me. Maybe he was fishing for the term incompatible interfaces?

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
The objective of the Adapter design pattern is to enable "objects" to work together. Your statement of using the pattern to make two "systems" work together is a bit off key.

"Systems" and "objects" are not the same terms and cannot be used interchangeably, in my opinion.

I would have been looking for you to explain the what, why and how of what you implemented in the "project", rather than a rudimentary answer not related to the "project." Demonstrating that you might know the definition of a design pattern does not show that you have experience implementing the pattern.
I agree. Here's the link: http://aspose.com/file-tools
subject: Adapter pattern question at an interview
It's not a secret anymore!