Contents | Prev | Next | Index


Member Visibility

The visibility of a component identifier is determined by the visibility attribute of the component section that declares the identifier. The possible visibility attributes are PUBLIC, PROTECTED and PRIVATE. For reasons of compatibility with the Borland Object Pascal dialect it is also possible to use the PUBLISHED and AUTOMATED attributes which are treated the same as PUBLIC in Canterbury Pascal. The default visibility attribute is PUBLIC. Here is a list of the visibility definitions:

Public components:
Component identifiers declared in PUBLIC sections have no special restrictions on their visibility.
Protected components:
Components declared as protected are accessible only to descendants of the declaring type. Declaring a component as protected combines the advantages of public and private components. As with private components, you can hide implementation details from end users. However, unlike private components, protected components are still available to programmers who want to derive new objects from your objects without the requirement that the derived objects be declared in the same unit.
Private components:
The visibility of a component identifier declared in a private component section is restricted to the program or unit that contains the class type declaration. Private component identifiers act like normal public components within the program or unit that contain its class type declaration, but outside the program or unit, any private components are unknown and inaccessable
Published components:
Same as public components in this compiler.
Automated components:
Same as public components in this compiler.


Contents | Prev | Next | Index

Canterbury Pascal for JVM  (Last documentation update Sep 02, 2004)
Copyright © 1999-2004 J.Neuhoff - mhccorp.com  . All rights reserved.
Please send any comments or corrections to neuhoff@mhccorp.com