Re: Question about seperating interfaces for clients
From: Universe (universe_at_tAkEcovadOuT.net)
Date: 06/24/04
- Next message: Universe: "Re: Review of Agile Documentation by Andreas Rueping"
- Previous message: Universe: "Re: Fans of Template Method with protected variable?"
- In reply to: Ken: "Question about seperating interfaces for clients"
- Next in thread: Robert Klemme: "Re: Question about seperating interfaces for clients"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 24 Jun 2004 00:50:13 -0400
kk_oop@yahoo.com (Ken) wrote:
> 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?
Implement the server objects like COM, where the object has multiple
interfaces and clients use a pointer to the interface they use. A
simple start with C++ would be use MI to incorporate each interface
into a single server class. A client uses a pointer to the interface
of interest, and thus does not see the other interfaces.
Not sure how changes to specific interface data (probably best
avoided), specific interface method signature, or specific interface
method count affects client not holding a pointer to that interface
would have to re-compile, and re-link. With COM it's unnecessary.
These are the good points of COM overlooked by many XP'ers whom
disdain COM.
Elliott
-- It's ludicrous to say "OO is.." and not to have the term *objects* somehow central, front and center in the definition. As for example: OO - a means for reducing complexity by viewing domains and creating programs with the object as the core granule of abstraction. Modelling objects, and with multiple objects, their collaboration is key to conceptualizing and managing domains and programs. ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
- Next message: Universe: "Re: Review of Agile Documentation by Andreas Rueping"
- Previous message: Universe: "Re: Fans of Template Method with protected variable?"
- In reply to: Ken: "Question about seperating interfaces for clients"
- Next in thread: Robert Klemme: "Re: Question about seperating interfaces for clients"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|