• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adapter pattern question at an interview

 
divya kundapur
Ranch Hand
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds good to me. Maybe he was fishing for the term incompatible interfaces?
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic