Delphi classes (Was: bugs, incompatibity, function_(re)

Thu, 03 Jul 1997 12:26:17 -0700



>>Is this the same as "public" in C++ (= visible to everyone)? I, personally,
>>would prefer "public", "protected" (=visible only to descendants) and
>>"private" (=visible only to the type/class itself -- BTW, BP does it a bit
>>differently, and extend the visibility of private methods to the whole unit
>>it's declared in. I don't see any reason or advantage of this). So, perhaps
>>we could allow all those keywords, including "published", in any order, also
>>possibly repeated (unlike BP).
>
>In Delphi there are four such directives:
>
>  public    - like in BP - visible for everyone
>  private   - like in BP - visible only for this unit (I don't see any
>                           advantages too)

   Having the 'private' declarations visible anywhere within the unit in
which it was defined is sort of a compatability thing with C++ 'friends'.
Correct me if I am wrong, but a C++ class can be defined as being 'friends'
with another class.  Since they are 'friends', they can share certain
properties. I personaly don't care for this.  There are better ways of
access properties in other classes!  Plus this breaks the idea of 'object
oriented' programming and provides a way around the OO paradigm.

>  protected - visible for this class and its descendants
>  published - same as public, but also accessible at the design time
>              (in Object Inspector) - I don't program Delphi, but as I
>              remember only properties were placed here.

   Right, only published propertied show up in the object inspector.  I
think for now, in GPC anyway, allow 'published' and treat it as a 'public'.
When GPC moves to X-windows or gains a visual/graphical development tool, we
should be able to utilize it better.

Just my thoughts...

Ken L
kc7rad@vegasnet.net
klinder@hn.com


Ken (kc7rad@vegasnet.net)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es