Interesting conversation. I am replying to Nahum's post because that's how it is for
me too.
One function of interfaces for us is as a specification of a service one element of our
application is responsible for providing to another. We can agree on the interface
definition
without constraining in any way the manner in which the interface is supported. This is
not the case if you're using classes to express interfaces.
The other thing that occurs is how nice it is to be able to provide things like
iterators
via simple functions. eg
function GetIterator: IIterator
instead of
procedure GetIterator( out Iterator: TIterator ).
Auto gargage collection doesn't seem to me to summarize the significance of this.
You've
removed the whole try finally nonsense responsibility from the client. The client
wants something,
he just asks for it. Simple. It's possible that interfaces kill the try-finally
construct stone dead.
We use interfaces to restore properties like cursors, and there's no reason why you
should't use
the same trick to call Printer.EndDoc etc..
However, I am in heated agreement with the proviso about mixing interfaces and classes.
And if you find yourself calling addref and release yourself you'd better know what
you're doing - you can definitely create major messes, especially at close down of
your app.
Interfaces rock!
Cheers,
Don Macrae
Nahum Wild wrote:
> You can get around the auto garbage collection easily enough. Neven's
> simple answer is a good one. They have a huge impact on how you design apps
> etc... - for the better.
>
> Yes I use interfaces. Learning about them was a "oh, why didn't I learn
> about these ages ago" type experience, a bit like going from procedural to
> object oriented. :)
>
> Nahum.
>
> > -----Original Message-----
> > From: Sandeep [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 13, 2001 11:57 AM
> > To: Multiple recipients of list delphi
> > Subject: Re: [DUG]: Interfaces
> >
> >
> > On 13 Jun 2001, at 10:46, Neven MacEwan wrote:
> >
> > > Sandeep
> > >
> > > Simple Answer - HUGE
> >
> > I haven't used them yet. And if it is used for automatic garbage
> > cleaning (I think I'm right here) then it may not be a good
> > programming practice, or it may be a lazy way of programming.
> >
> > Sandeep
> >
> > Software Developer
> > CFL
> > [EMAIL PROTECTED]
> > http://www.cfl.co.nz
> >
> > --------------------------------------------------------------
> > -------------
> > 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"
> >
> ---------------------------------------------------------------------------
> 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"
--
----------------------------------------------------------
Don Macrae, Excellent Programming Company
mailto:[EMAIL PROTECTED]
----------------------------------------------------------
---------------------------------------------------------------------------
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"