• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

adapter-pattern

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.avajava.com/tutorials/lessons/adapter-pattern.html?page=2

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.


http://www.fluffycat.com/Java-Design-Patterns/Adapter/

2-
http://www.avajava.com/tutorials/lessons/adapter-pattern.html?page=2

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
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic