473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

About the adaptor design pattern

Hello!

I'm reading about design pattern adaptor in the GOF book and
there is something that sounds strange.

When you use the adaptor design pattern you have these participants.
*Target
- defines the domain-specific interface that Client uses.

* Client
- collaborates with objects conforming to the Target interface.

*Adaptee
- defines an existing interface that needs adapting.???

*Adaptor
- adapts the interface of Adaptee to the Target interface???

Now to my first question. I can't understand the text row for Adaptee saying
"defines an existing interface that needs adapting."
What does they mean when the existing class needs adapting?
No class need any kind of adapting as I understant it.
The adaptor design pattern say that you just use the implementation from the
existing class.

Here the second question. I can't understand the text row for Adaptor saying
"adapts the interface of Adaptee to the Target interface"
The same here this must be wrong saying adapts the interface of Adaptee to
the Target interface.

Many thanks

//Tony

Sep 2 '05 #1
1 3276

"Tony Johansson" <jo*****************@telia.com> wrote in message
news:F3*********************@newsc.telia.net...
Now to my first question. I can't understand the text row for Adaptee
saying
"defines an existing interface that needs adapting."
What does they mean when the existing class needs adapting?
No class need any kind of adapting as I understant it.
The adaptor design pattern say that you just use the implementation from
the existing class.
Did you see my responce regarding DirectX versus OpenGL? Sometimes you
have two classes, and you want them to communicate, but their interfaces are
not compatible. Thus it needs adapting.

Here the second question. I can't understand the text row for Adaptor
saying
"adapts the interface of Adaptee to the Target interface"
The same here this must be wrong saying adapts the interface of Adaptee to
the Target interface.


This isn't a question, but I'll try to guess what the question it is
that you are asking. Here's the answer to what I assume your question is:
"No, it's correct."

- Oliver
Sep 2 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Omer van Kloeten | last post by:
The Top Level Design: The class Base is a factory class with a twist. It uses the Assembly/Type classes to extract all types that inherit from it and add them to the list of types that inherit...
0
by: Tony Johansson | last post by:
Hello! I'm reading about design pattern adaptor in the GOF book and there is something that sounds strange. The text below each participant is the book explanation for each participant. I...
0
by: Tony Johansson | last post by:
Hello! Below is a small program using the adaptor pattern. We have four classes these are: PegAdapter, RoundPeg, SquarePeg and a class TestPegs acting like a client In class PegAdapter has...
11
by: FluffyCat | last post by:
In Febraury - April of 2002 I put together in Java examples of all 23 of the classic "Gang Of Four" design patterns for my website. Partly I wanted to get a better understanding of those patterns....
4
by: FluffyCat | last post by:
New on November 29, 2005 for www.FluffyCat.com PHP 5 Design Pattern Examples - the Command Pattern. Since you all enjoyed the Visitor Pattern so much yesterday, today I have the Command Pattern...
12
by: Michael S | last post by:
Why do people spend so much time writing complex generic types? for fun? to learn? for use? I think of generics like I do about operator overloading. Great to have as a language-feature, as...
22
by: Krivenok Dmitry | last post by:
Hello All! I am trying to implement my own Design Patterns Library. I have read the following documentation about Observer Pattern: 1) Design Patterns by GoF Classic description of Observer....
19
by: adriancico | last post by:
Hi I am working on a python app, an outliner(a window with a TreeCtrl on the left to select a document, and a RichTextBox at the right to edit the current doc). I am familiarized with OOP...
2
by: Duy Lam | last post by:
Hi everyone, Sorry, I don't know what group to post this problem, I think may be this group is suitable. I'm styduing DAO (Data Access Object) pattern in this link...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.