Designing issue

M

mojtaba_danai

Hi

I am trying to make a adapter program.
-There can be different kind of adapters, which each can take data from
one source.
-It should be possible to plugin the new adapter for a new source of
data.
-The adapters all make a common structure to give it to the connected
clients. (I have implemented this part).
-Each adapter uses a specific API to collect data from data source.

How the design of the adapter class should look like? Which design
pattern?

Thanks.

Regards
mojtaba
 
M

mojtaba_danai

Hi again
Just wanted to add:

There should probably be a superclass for all adapters, right? But they
use different APIs, as I said before, and one of the adapters inherits
already from couple of data source API classes.

Thanks.

Regards
mojtaba
 
P

Phlip

mojtaba_danai said:
There should probably be a superclass for all adapters, right?

Why? Will anything ever use a reference to this superclass, not knowing
which derived type it wields?

Design is not about abstracting everything, it's about defining minimal and
useful interfaces.
 
M

mojtaba_danai

Hi

Thanks for the answer. Then, what is the good approach to this problem?

Making plugable adapters?

Regards
mojtaba
 
M

mojtaba_danai

Hi

The original message was this:

I am trying to make a adapter program.
-There can be different kind of adapters, which each can take data from


one source.
-It should be possible to plugin the new adapter for a new source of
data.
-The adapters all make a common structure to give it to the connected
clients. (I have implemented this part).
-Each adapter uses a specific API to collect data from data source.

How the design of the adapter class should look like? Which design
pattern?
There should probably be a superclass for all adapters, right? But they


use different APIs, as I said before, and one of the adapters inherits
already from couple of data source API classes.

Thanks.

Regards
mojtaba
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top