Karl Reynolds asked me:
> Hmmm. I'd like to hear of a situation where you wouldn't want an ancestor
> interface to be available where the descendant is.
OK, one example I foiund within two minutes of looking into the MSDN is the
follwing quote directly from Microsoft:
(ms-help://MS.MSDNQTR.2003APR.1033/wcedcom/htm/cerefISequentialStreamIUnknow
n.htm)
-----------------------------
You can implement ISequentialStream on an object if you require simple
sequential access to a stream object. If you implement IStream, you must
provide an implementation of the Read and Write methods from
ISequentialStream.
Note: Most applications do not implement ISequentialStream as a separate
interface, and you are not required to provide it separately even if you
provide an IStream implementation. For example, the compound file
implementation of structured storage does not succeed on a QueryInterface
method for ISequentialStream but it includes the Read and Write methods
through the IStream interface pointer.
----------------------------
So this is one simple case where you have IStream inheriting from
ISequentialStream (see ActiveX.pas) but you are not required to implement
ISequentialStream is you are implementing IStream.
And if it was this easy to find one simple example I suspect that there are
a lot of other cases where Microsoft is building interfaces up out of more
basic and general interface specifications that are need not be implemented
by themselves.
> I think it was a mistake of Borland not to include ancestor
> interfaces automatically.
I'm going to stick to my opinion that explicit declarations of interface
support provide much more safety and obvious programming behaviour, than
unexpected implicit interface being provided on your class.
Cheers, Max.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/