I would be very careful about using Pascal style Objects in any *new* Delphi
code. This is due to Borland's explicit mention that they are only supported
for backward compatibility. Evidence of this can already be seen with Delphi
5 not supporting long strings inside Pascal Objects - a feature stopping us
from moving to D5 right now.

As long as you have a consistent convention regarding the ownership of
objects being passed around then it would probably be better to do them as
TObjects, even with the slight bit of overhead.

Xander


----- Original Message -----
From: Wilfred Verkley <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Thursday, December 09, 1999 10:13 AM
Subject: RE: [DUG]: Passing objects as procedure parameters


> >This is purely syntactical and the help explains this.  In BP7 (old way),
> >you always do a '^.', but Borland changed that to '.' in Delphi.  Its not
a
> >lie.  It is the way Delphi has been designed, and IMHO, is better than
the
> >'^.' construct, and certainly better than C++'s '.' and '->' constructs.
I
> >guess the only down-side to using '.' is that it is used to denote fields
> in
> >records, thus making its use inconsistent.
>
> This "implicit referencing" isnt just for objects, you can use it for
record
> structures as well.
>
>   TRecordA = record
>     value : integer;
>   end;
>
>   TRecordB = record
>     recordA : ^TRecordA;
>   end;
>
>   recordB.recordA.value := 123;
>
> >However, IMHO, OO programming ought not to use records anyway.
>
> Why not?  Should something simple like TPoint be an object?  Objects can
> also be a nuicense when you just want to hold and pass around simple data.
> I still use records or the old BP7 object model sometimes for simple data
> types.
>
> i.e.
>
>   TMyPoint = object
>   public
>     x, y : double;
>     function length : double;
>     ...
>   end;
>
> You can define arrays of them, pass them around by value, you dont have to

> dynamically create and destroy them etc etc.
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>
>


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to