Question about seperating interfaces for clients
From: Ken (kk_oop_at_yahoo.com)
Date: 06/24/04
- Next message: Universe: "Re: My Enterprise Architecture - your thoughts?"
- Previous message: Daniel T.: "Re: Fans of Template Method with protected variable?"
- Next in thread: Phlip: "Re: Question about seperating interfaces for clients"
- Reply: Phlip: "Re: Question about seperating interfaces for clients"
- Reply: Universe: "Re: Question about seperating interfaces for clients"
- Reply: Robert Klemme: "Re: Question about seperating interfaces for clients"
- Reply: Ilja Preuß: "Re: Question about seperating interfaces for clients"
- Reply: H. S. Lahman: "Re: Question about seperating interfaces for clients"
- Reply: Daniel T.: "Re: Question about seperating interfaces for clients"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 23 Jun 2004 19:42:50 -0700
Hi.
I have a class used by many clients. I want to tailor the interface
for each client. I figure there are two ways to do this:
1- Make a wrapper to be used by each client. The wrapper would only
make visible those methods the client needs. Each of its methods
would delegate behavior to the equivelent method in the wrapped object
(ie, the adapter pattern).
2- Have the class "implement" an interface for each client. A
client's interface would only include the methods it needs.
Option 2 seems simpler, but it creates a dependency between the
implementation class and its various clients. However, in option 1,
you need to write the delegation code. So normally, I lean to option
2.
However, I have a situation where this class is used by classes in
several distributed components. In this case I'm thinking that option
1 is better to avoid making not just a class--but an entire component
dependent on a seperate client component.
Any thoughts?
Thanks,
Ken
- Next message: Universe: "Re: My Enterprise Architecture - your thoughts?"
- Previous message: Daniel T.: "Re: Fans of Template Method with protected variable?"
- Next in thread: Phlip: "Re: Question about seperating interfaces for clients"
- Reply: Phlip: "Re: Question about seperating interfaces for clients"
- Reply: Universe: "Re: Question about seperating interfaces for clients"
- Reply: Robert Klemme: "Re: Question about seperating interfaces for clients"
- Reply: Ilja Preuß: "Re: Question about seperating interfaces for clients"
- Reply: H. S. Lahman: "Re: Question about seperating interfaces for clients"
- Reply: Daniel T.: "Re: Question about seperating interfaces for clients"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|