Differing implementations for a function in two interfaces
BCS
BCS_member at pathlink.com
Mon Apr 17 14:53:17 PDT 2006
Chris Nicholson-Sauls wrote:
> Ryan Steen wrote:
>
>> In article <e1vlnb$226i$1 at digitaldaemon.com>, Lionello Lunesu says...
>>
>>> IA might be an interface for the output/GUI and IB for the input.
>>
>>
>>
>> Yes, but what might cause the need to have the implementation in one
>> class?
>>
>> And if there is really a need what hinders a virtual split of that
>> implenting
>> class?
>>
>> IA --> CA <-- C --> CB <-- IB
>>
>> where --> and <-- denote inheretance?
>
> Here you lose encapsulation, wherein you are basically having to create
> a C, then ask it for its CA and later for its CB, and the CA/CB classes
> (inner classes, maybe?) have to know their parent object and ask it for
> the real data and behaviors. Ew, ew, ew.
I fully agree.
>(Although at least inner
> classes won't need the parent pointer,
yes but only because its already hidden in there by the compiler
> once we settle on some kind of
> 'parent' or 'outer' keyword.)
>
> -- Chris Nicholson-Sauls
More information about the Digitalmars-d-learn
mailing list