Re: [DUG] Interfaces

2008-08-07 Thread Alister Christie
If I have TPerson = class(TInterfacedObject, ISpeakable) Procedure MakeANoise(n : INoiseable); begin n.MakeNoise; end; and var Person : TPerson; begin Person := TPerson.Create; MakeANoise(Person); //Incompatible types: 'INoiseable' and 'TPerson' end; I can't pass a TPerson to an IN

Re: [DUG] Interfaces

2008-08-07 Thread Todd Martin
That is exactly right, but why would you want to, when ISpeakable supports makeNoise() anyway? You can still pass your TPerson object into a method(AObject : INoiseable) without problems. Todd. > However if I change my TPerson to the following > TPerson = class(TInterfacedObject, ISpeakable, I

Re: [DUG] Interfaces

2008-08-07 Thread Alister Christie
Okay here is my second bit of confusion cleared up regarding interface inheritance. If I declare the following types Type INoiseable = interface ['{B7A2C437-EC4C-485D-B7E2-CD085E8414BE}'] procedure MakeNoise; end; ISpeakable = interface(INoiseable) ['{E789E48D-4105-4181-B644-96B94F27E

Re: [DUG] Interfaces

2008-08-07 Thread Alister Christie
No, There is some other stuff that is confusing me also to do with interface inheritance - I think I'm going to have to do some reading. Alister Christie Computers for People Ph: 04 471 1849 Fax: 04 471 1266 http://www.salespartner.co.nz PO Box 13085 Johnsonville Wellington Todd Martin wrote

Re: [DUG] Interfaces

2008-08-06 Thread Todd Martin
Hi Alister Are you implementing IXMLResidentialType via delegation? Todd. > I'm having some fun with interfaces > > I have two interfaces IXMLResidentialType and IAuctionable. > I have a class which implements these two interfaces > TXMLResidentialType = class(TXMLNode, IXMLResidentialType, IAuct

Re: [DUG] Interfaces

2008-08-06 Thread Richard Bullin
Richard.Bullin Web www.framecad.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Myles Penlington Sent: Thursday, 7 August 2008 2:56 p.m. To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] Interfaces Should work as is by the looks of it.

Re: [DUG] Interfaces

2008-08-06 Thread Myles Penlington
:47 p.m. To: NZ Borland Developers Group - Delphi List Subject: [DUG] Interfaces I'm having some fun with interfaces I have two interfaces IXMLResidentialType and IAuctionable. I have a class which implements these two interfaces TXMLResidentialType = class(TXMLNode, IXMLResidentia

[DUG] Interfaces

2008-08-06 Thread Alister Christie
I'm having some fun with interfaces I have two interfaces IXMLResidentialType and IAuctionable. I have a class which implements these two interfaces TXMLResidentialType = class(TXMLNode, IXMLResidentialType, IAuctionable) ... I have some code var Res : IXMLResidentialType; Auctionable : IAuc

Re: [DUG]: Interfaces without reference counting

2003-01-28 Thread Todd Martin
Thanks. That confirms my own more recent thoughts on this. Todd. - Original Message - From: "Dennis Chuah" <[EMAIL PROTECTED]> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]> Sent: Wednesday, 29 January 2003 15:41 Subject: Re: [DUG]: Inter

Re: [DUG]: Interfaces without reference counting

2003-01-28 Thread Dennis Chuah
. - Original Message - From: "Todd Martin" <[EMAIL PROTECTED]> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]> Sent: Wednesday, January 29, 2003 11:11 AM Subject: [DUG]: Interfaces without reference counting > Hi. I'm trying to use interfaces in D

[DUG]: Interfaces without reference counting

2003-01-28 Thread Todd Martin
Hi. I'm trying to use interfaces in Delphi, but I want to disable reference counting. So I created a new class (shown below) with a method to free the object, but when I call ReleaseObject() I get an access violation after "Free". Anyone got any ideas about how I can free the interfaced object when

[DUG]: interfaces...

2002-08-20 Thread Mark Derricutt
'lo - question on interfaces and reference counting/freeing. I'm creatng an interface in Kylix, thats not descended from TInterfacedObject, so I'm adding _Addref _Release and QueryInterface myself (I'm descending from TPersistent), in _Addref and _Release I'm simply returning 1, which I've see

Re: [DUG]: Interfaces (and classes that support them)

2002-08-08 Thread Dennis Chuah
ultiple recipients of list delphi" <[EMAIL PROTECTED]> Sent: Thursday, August 08, 2002 1:11 PM Subject: Re: [DUG]: Interfaces (and classes that support them) > Phil, > Thanks for the idea, but it kinda breaks the idea of an Interface being > supported by *ANY* class typ

RE: [DUG]: Interfaces

2001-06-15 Thread Paul Spain
Hi Andrew et al, At 21:11 15/06/01 , you wrote: >I'm not sure if this functionality in D6, maybe someone could clarify, but >in theory you should be able to drop a TEdit on a form, right click on it, Danny Thorpe goes into some detail about new interface features in D6: http://community.borland.

RE: [DUG]: Interfaces

2001-06-15 Thread Andrew Little
TECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Sandeep Sent: Wednesday, 13 June 2001 10:27 a.m. To: Multiple recipients of list delphi Subject: [DUG]: Interfaces Is there any advantage of using interfaces? Sandeep Software Developer CFL [EMAIL PROTECTED] http:

Re: [DUG]: Interfaces

2001-06-13 Thread Paul Spain
At 17:02 13/06/01 , you wrote: > function GetIterator: IIterator > >Auto gargage collection doesn't seem to me to summarize the significance of this. You've I don't think you can overstate the significance of garbage collection or more generally, resource management. Its straightforward to clean

Re: [DUG]: Interfaces

2001-06-13 Thread Don Macrae
Peter, I'm not sure what your question refers to, but if it's my suggestion that try-finally is dead then it concerns a neat little trick I got from a presentation by Malcolm Groves at the last Borcon - his IRestore interface. You can get the details from Malcolm's web site at http://www.madriga

Re: [DUG]: Interfaces

2001-06-13 Thread Peter Hyde
Don wrote: > 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 construc

Re: [DUG]: Interfaces

2001-06-12 Thread Don Macrae
ke 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]: Interfac

Re: RE: [DUG]: Interfaces

2001-06-12 Thread Nello Sestini
> If I have to redeclare all the methods in interface in the descended > class then why not get rid of interface and I still have the same > thing. It's not the same thing. Just because you have implemented methods Quack(), and Walk() doesn't mean that a client application expecting to use yo

RE: RE: [DUG]: Interfaces

2001-06-12 Thread Max Nilson
Sandeep asks: > If I have to redeclare all the methods in interface in the descended > class then why not get rid of interface and I still have the same > thing. What's wrong with that? Nothing, but if you want to have two seperate object hiearchies sharing the same interface you only have two c

RE: RE: [DUG]: Interfaces

2001-06-12 Thread Sandeep
On 13 Jun 2001, at 14:53, Max Nilson wrote: > Sandeep asks: > > > How do interfaces help i n multiple inheritence? If > > I have a ClassA and ClassB then if I want to inherit ClassC from > > ClassA its simple. But if I want to inherit from ClassA and ClassB > > then using interface I have to imp

Re: RE: [DUG]: Interfaces

2001-06-12 Thread David Brennan
> Neven MacEwan quite correctly points out: > > > You can also delegate the inplemenation of an interface in delphi > > > ie > > > > TClassC - class(TClassA, InterfaceB) > > private > > FClassB: TClassB > > property > > InstClassB read FClassB write FClassB implements InterfaceB > > end > > B

RE: RE: [DUG]: Interfaces

2001-06-12 Thread Max Nilson
Neven MacEwan quite correctly points out: > You can also delegate the inplemenation of an interface in delphi > ie > > TClassC - class(TClassA, InterfaceB) > private > FClassB: TClassB > property > InstClassB read FClassB write FClassB implements InterfaceB > end But if you are doing any CO

Re: RE: [DUG]: Interfaces

2001-06-12 Thread Neven MacEwan
D]> Sent: Wednesday, 13 June 2001 14:19 Subject: Re: RE: [DUG]: Interfaces > How do interfaces help i n multiple inheritence? If > I have a ClassA and ClassB then if I want to inherit ClassC from > ClassA its simple. But if I want to inherit from ClassA and ClassB > then using int

RE: RE: [DUG]: Interfaces

2001-06-12 Thread Max Nilson
Colin Fraser asked: > Any disadvantages using Interfaces??? Not really. The main issue is designing your classes so that you can actually take advantage of interfaces, rather than deep inheritance. > Any slower performance??? No. Delphi interfaces are actually implemented as pointers to a part

RE: RE: [DUG]: Interfaces

2001-06-12 Thread Max Nilson
Sandeep asks: > How do interfaces help i n multiple inheritence? If > I have a ClassA and ClassB then if I want to inherit ClassC from > ClassA its simple. But if I want to inherit from ClassA and ClassB > then using interface I have to implement all the functions in ClassB > again in ClassC, so

Re: RE: [DUG]: Interfaces

2001-06-12 Thread Sandeep
How do interfaces help i n multiple inheritence? If I have a ClassA and ClassB then if I want to inherit ClassC from ClassA its simple. But if I want to inherit from ClassA and ClassB then using interface I have to implement all the functions in ClassB again in ClassC, so how does it makes li

RE: RE: [DUG]: Interfaces

2001-06-12 Thread Colin Fraser
Any disadvantages using Interfaces??? Any slower performance??? Anything to look out for??? Regards Colin ## Attention: The information in this email and in any attachments is confidential. If you are not the intended reci

Re: RE: [DUG]: Interfaces

2001-06-12 Thread Nello Sestini
> Ok, give a poor C++ programmer a hint... what are we talking about here? > interfaces are another way representing what "multiple inheritance" (I think poorly) attempts to represent in C++ > Specifically, I've seen many definitions for 'interfaces', but none of > them seems to quite fit the

Re: [DUG]: Interfaces

2001-06-12 Thread Neven MacEwan
Nic > I design with them now - much easier, from my POV. They are used > extensivly in Java as well, so its good practice if you are ever > going to move. Also good practive if your not, A lot of the OO Technology is centred around the concept of interfaces (since I think multiple inheritance ha

Re: [DUG]: Interfaces

2001-06-12 Thread Neven MacEwan
ROTECTED]> To: Multiple recipients of list delphi <[EMAIL PROTECTED]> Sent: Wednesday, 13 June 2001 11:56 Subject: Re: [DUG]: Interfaces > On 13 Jun 2001, at 10:46, Neven MacEwan wrote: > > > Sandeep > > > > Simple Answer - HUGE > > I haven't used them y

Re: RE: [DUG]: Interfaces

2001-06-12 Thread Nic Wise
> Ok, give a poor C++ programmer a hint... what are we talking about here? > I think you lot call them "pure virtual classes" - ie a class with no implementation. In Delphi, you can inherit from more than one of them, which is a big advantage. > Specifically, I've seen many definitions for '

RE: [DUG]: Interfaces

2001-06-12 Thread Max Nilson
Sandeep commented: > Only one reply so far, so should I assume that there are not many > people using Interfaces. Interfaces are useful for a variety of things. In object oriented programming terms that are used to implement the concept of generisity, and this complements polymorphism and inheri

Re: [DUG]: Interfaces

2001-06-12 Thread Nic Wise
I design with them now - much easier, from my POV. They are used extensivly in Java as well, so its good practice if you are ever going to move. Nic. > On 13 Jun 2001, at 10:46, Neven MacEwan wrote: > > > Sandeep > > > > Simple Answer - HUGE > > Only one reply so far, so should I assume that

Re: RE: [DUG]: Interfaces

2001-06-12 Thread Corey Murtagh
Nahum Wild <[EMAIL PROTECTED]> wrote on 13/06/2001 11:53:45: > >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, w

Re[2]: [DUG]: Interfaces

2001-06-12 Thread paul . mckenzie
Reply Separator Subject: Re: [DUG]: Interfaces Author: [EMAIL PROTECTED] Date: 13/06/2001 11:58 On 13 Jun 2001, at 10:46, Neven MacEwan wrote: > Sandeep > > Simple Answer - HUGE Only one reply so far, so should I as

RE: [DUG]: Interfaces

2001-06-12 Thread Nahum Wild
perience, 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 > > > O

Re: [DUG]: Interfaces

2001-06-12 Thread Sandeep
On 13 Jun 2001, at 10:46, Neven MacEwan wrote: > Sandeep > > Simple Answer - HUGE Only one reply so far, so should I assume that there are not many people using Interfaces. Sandeep Software Developer CFL [EMAIL PROTECTED] http://www.cfl.co.nz

Re: [DUG]: Interfaces

2001-06-12 Thread Sandeep
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 Devel

Re: [DUG]: Interfaces

2001-06-12 Thread Neven MacEwan
Sandeep Simple Answer - HUGE Neven - Original Message - From: Sandeep <[EMAIL PROTECTED]> To: Multiple recipients of list delphi <[EMAIL PROTECTED]> Sent: Wednesday, 13 June 2001 10:27 Subject: [DUG]: Interfaces > Is there any advantage of using interfaces? > >

[DUG]: Interfaces

2001-06-12 Thread Sandeep
Is there any advantage of using interfaces? Sandeep Software Developer CFL [EMAIL PROTECTED] http://www.cfl.co.nz --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://

RE: [DUG]: Interfaces Again ;)

1999-04-11 Thread Myles Penlington
f list delphi Subject: Re: [DUG]: Interfaces Again ;) >If you have done it right, there should not be a problem. >In your example, when you create your delegation object - >In your TMyOBject.Create you need to have a ._addref on >your delegation object, ie >TMyOBject hold

Re: [DUG]: Interfaces Again ;)

1999-04-11 Thread Aaron Scott-Boddendijk
>If you have done it right, there should not be a problem. >In your example, when you create your delegation object - >In your TMyOBject.Create you need to have a ._addref on >your delegation object, ie >TMyOBject holds a reference to your object. > >When TMyObject is destroyed, in it's destructor

RE: [DUG]: Interfaces Again ;)

1999-04-11 Thread Myles Penlington
e recipients of list delphi Subject: [DUG]: Interfaces Again ;) I have a question regarding interface delegation and reference counting. If a non interfaced object is extended with an interface and that interface uses delegation to implement that interface then how is instance destruction

[DUG]: Interfaces Again ;)

1999-04-11 Thread Aaron Scott-Boddendijk
I have a question regarding interface delegation and reference counting. If a non interfaced object is extended with an interface and that interface uses delegation to implement that interface then how is instance destruction detected by the delegating class. Example below if the following is do