Re: [fpc-devel] interfaces vs classes in dll

2007-12-03 Thread Michael Schnell
I suppose we are discussing the Delphi language keyword "interface" and it's implementation in free pascal. -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

RE: [fpc-devel] interfaces vs classes in dll

2007-12-03 Thread Helmut Hartl
>> One advantage is that it can be easely used on many languages, >> althougth the usefulness of that for ideintf is probably very small. >> >I suppose you mean programming languages not spoken languages. >But Interface is a Delphi language keyword. I don't see what this has to with C or whate

Re: [fpc-devel] interfaces vs classes in dll

2007-12-03 Thread Michael Schnell
One advantage is that it can be easely used on many languages, althougth the usefulness of that for ideintf is probably very small. I suppose you mean programming languages not spoken languages. But Interface is a Delphi language keyword. I don't see what this has to with C or whatever.

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Felipe Monteiro de Carvalho
On Nov 30, 2007 10:12 AM, Michael Schnell <[EMAIL PROTECTED]> wrote: > What is the advantage of interfaces anyway (seems that I have been > missing something ... ) One advantage is that it can be easely used on many languages, althougth the usefulness of that for ideintf is probably very small. -

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Michael Van Canneyt
On Fri, 30 Nov 2007, Mattias Gaertner wrote: > On Fri, 30 Nov 2007 13:22:54 +0100 (CET) > Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > > > > > > On Fri, 30 Nov 2007, Paul Ishenin wrote: > > > > > Michael Van Canneyt wrote: > > > > No-one. The DLL must be recompiled anyway if you use pa

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Mattias Gaertner
On Fri, 30 Nov 2007 13:22:54 +0100 (CET) Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > > On Fri, 30 Nov 2007, Paul Ishenin wrote: > > > Michael Van Canneyt wrote: > > > No-one. The DLL must be recompiled anyway if you use packages. > > > And this is also true if you use interfaces, so usin

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Michael Van Canneyt
On Fri, 30 Nov 2007, Paul Ishenin wrote: > Michael Van Canneyt wrote: > > No-one. The DLL must be recompiled anyway if you use packages. > > And this is also true if you use interfaces, so using interfaces > > will not solve the problem you mention. > > > Only if compiler (who provides packag

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Paul Ishenin
Michael Van Canneyt wrote: No-one. The DLL must be recompiled anyway if you use packages. And this is also true if you use interfaces, so using interfaces will not solve the problem you mention. Only if compiler (who provides package system) changed. Ide changes will not cause recompilation o

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Michael Schnell
I even do have that book right behind me on the shelf. Silly me should have looked there :(. -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Vincent Snijders
Marc Weustink schreef: Vincent Snijders wrote: Michael Van Canneyt schreef: I find classes more natural than interfaces. It 'just works'. Not so with interfaces, because you must do a typecast every time. Compare Function GetPluginInterface : ISOmeThing; begin X:=MyPluginObjectXYZ.Creat

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Michael Schnell
OK, Thanks, -Michael ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Marc Weustink
Vincent Snijders wrote: Michael Van Canneyt schreef: I find classes more natural than interfaces. It 'just works'. Not so with interfaces, because you must do a typecast every time. Compare Function GetPluginInterface : ISOmeThing; begin X:=MyPluginObjectXYZ.Create; Result:=X as ISomet

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Vincent Snijders
Michael Van Canneyt schreef: I find classes more natural than interfaces. It 'just works'. Not so with interfaces, because you must do a typecast every time. Compare Function GetPluginInterface : ISOmeThing; begin X:=MyPluginObjectXYZ.Create; Result:=X as ISomething; end; This is then

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Michael Van Canneyt
On Fri, 30 Nov 2007, Paul Ishenin wrote: > Michael Van Canneyt wrote: > > > > > Classes: > > > > - No reference counting mess. - Easier to grasp conceptually. > > > > > > > In plugin dll? > > > > Sure. Why not ? Obviously, the DLL needs to use packages, but that is > > understood. > > I me

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Graeme Geldenhuys
On 30/11/2007, Michael Schnell <[EMAIL PROTECTED]> wrote: > > > What is the advantage of interfaces anyway (seems that I have been > missing something ... ) > Many others have answered this already, so I'm not going to type out the answer. Instead, I'll just quote some of them This should gi

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Michael Schnell
Since I assume the DLL use is the scenario that is wanted, it de facto means that you must use widestrings. What about old fashioned PChar ? Everybody using the Windows and Linux APIs is used to that. -Michael ___ fpc-devel maillist - fpc-deve

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Daniël Mantione
Op Fri, 30 Nov 2007, schreef Martin Schreiber: > On Friday 30 November 2007 10.26, Michael Van Canneyt wrote: > > > > When you pass an interface that uses ansistrings to a DLL, > > the ansistrings in it (or referenced by it) may be disposed > > of by the wrong memory manager. > > > > Since I ass

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Martin Schreiber
On Friday 30 November 2007 10.26, Michael Van Canneyt wrote: > > When you pass an interface that uses ansistrings to a DLL, > the ansistrings in it (or referenced by it) may be disposed > of by the wrong memory manager. > > Since I assume the DLL use is the scenario that is wanted, > it de facto me

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Paul Ishenin
Michael Van Canneyt wrote: Classes: - No reference counting mess. - Easier to grasp conceptually. In plugin dll? Sure. Why not ? Obviously, the DLL needs to use packages, but that is understood. I mean what is easier to grasp conceptually when you use class in dll instead of interface?

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Michael Van Canneyt
On Fri, 30 Nov 2007, Paul Ishenin wrote: > > > Michael Van Canneyt пишет: > > On Thu, 29 Nov 2007, Mattias Gaertner wrote: > > > > > > > Lazarus has the IDEIntf, the API for IDE plugins. > > > > > > What is better in this case: classes or interfaces? > > > > > > > Classes: > > - No ref

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Marco van de Voort
> > What is better in this case: classes or interfaces? > > > What is the advantage of interfaces anyway (seems that I have been > missing something ... ) A limited form of multiple inheritance. > I _thought_ it would be reference counting, but in the other thread > someone wants to (and do

Re: [fpc-devel] interfaces vs classes in dll

2007-11-30 Thread Michael Schnell
What is better in this case: classes or interfaces? What is the advantage of interfaces anyway (seems that I have been missing something ... ) I _thought_ it would be reference counting, but in the other thread someone wants to (and does) use Interfaces without reference counting. -Mich

Re: [fpc-devel] interfaces vs classes in dll

2007-11-29 Thread Paul Ishenin
Michael Van Canneyt пишет: On Thu, 29 Nov 2007, Mattias Gaertner wrote: Lazarus has the IDEIntf, the API for IDE plugins. What is better in this case: classes or interfaces? Classes: - No reference counting mess. - Easier to grasp conceptually. In plugin dll? - You can use an

Re: [fpc-devel] interfaces vs classes in dll

2007-11-29 Thread Michael Van Canneyt
On Thu, 29 Nov 2007, Mattias Gaertner wrote: > Lazarus has the IDEIntf, the API for IDE plugins. > > What is better in this case: classes or interfaces? Classes: - No reference counting mess. - Easier to grasp conceptually. - You can use ansistrings. Interfaces require widestrings. (olestring

Re: [fpc-devel] interfaces vs classes in dll

2007-11-29 Thread Marc Weustink
Mattias Gaertner wrote: Lazarus has the IDEIntf, the API for IDE plugins. What is better in this case: classes or interfaces? What if someday there are packages? What if someday there is a closed source dll plugin? 3x Interfaces (you need a shared memmanager in this case) Additional advantag