Board index » delphi » COM design: r/o property vs. function

COM design: r/o property vs. function

Hi,

does it make much of a difference if I use a read-only property
instead of a function?

AFAIK (which is embarrassingly little), the only difference should be
that browsers would show the property while leaving the function
alone?

--
Stefan.Hoffmeister (at) Uni-Passau.de
http://kakadu.rz.uni-passau.de/~w4hoff01/
   DIR: Delphi FAQs, KBs, docs

Private email regarding Delphi will usually be ignored
unless it has been expressedly invited.

 

Re:COM design: r/o property vs. function


Hello,

Quote
Stefan Hoffmeister wrote in message <35b1f55d.6074...@forums.inprise.com>...
>Hi,

>does it make much of a difference if I use a read-only property
>instead of a function?

Nope. Properties were only designed to make Ole Automation on the
client-side a bit simpler, especially for scripting clients. In other words,
it would be more "object-like" or "intuitive" to say:

x := Server.Data;
Server.Data := y;

instead of

x := Server.GetData;
Server.SetData (y);

Quote
>AFAIK (which is embarrassingly little), the only difference should be
>that browsers would show the property while leaving the function
>alone?

Yes.

Quote

>--
>Stefan.Hoffmeister (at) Uni-Passau.de
>http://kakadu.rz.uni-passau.de/~w4hoff01/
>   DIR: Delphi FAQs, KBs, docs

>Private email regarding Delphi will usually be ignored
>unless it has been expressedly invited.

have fun,

--
Binh Ly
Brickhouse Data Systems, Inc.
http://www.brickhouse.com

Other Threads