This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes adapter-pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "adapter-pattern" Watch "adapter-pattern" New topic


abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635

I wanted to learn adapter-pattern. I read that tutorial,...

I know adapter pattern is like real adapter,:

1-What does this mean?
In the Adapter Design Pattern, a class converts the interface of one class to be what another class expects.


TemperatureClassReporter is a class adapter.

...TemperatureObjectReporter is an object adapter.

class adapter and object adapter?!!

May someone explain more about this tutorial?
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

Answer to question 1 is as follows,

Now if you implement the WindowListener interface, you need to implement all the methods declared in the WindowListener interface. However, if you extend the WindowAdapter class you may over-ride only the required methods.

Not many get the right opportunity !
I agree. Here's the link:
subject: adapter-pattern
It's not a secret anymore!