ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / OOP (Object Oriented Programming)
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Access rights to a class property: special cases
The retrieval and assignment processes can be public, private or protected. The access rights of the property correspond to the less restrictive rights of the two processes.
Property access rights based on treatment access rights:
Assignment process
/
Retrieval process
Public
Protected
Private
PublicPublicPublicPublic
ProtectedPublicProtectedProtected
PrivatePublicProtectedPrivate

The properties are accessible on the instances and by inheritance by respecting the standard restrictions of the public, protected and private inheritances.
If the access rights allow reading and not writing, the property is considered read-only.
If the access rights allow writing and not reading, the property is considered write-only.
These cases trigger an error during the compilation but no error is triggered at runtime.
The tables below present the possible cases:
  • Using the class:
    Assignment process
    /
    Retrieval process
    Public
    Protected
    Private
    PublicRead/WriteWrite-onlyWrite-only
    ProtectedRead-onlyProtectedProtected
    PrivateRead-onlyProtectedPrivate

    Use of a derived class:
    Assignment process
    /
    Retrieval process
    Public
    Protected
    Private
    PublicRead/WriteRead/WriteWrite-only
    ProtectedRead/WriteRead/WriteWrite-only
    PrivateRead-onlyRead-onlyPrivate
  • Using a class with inheritance public:
    Assignment process
    /
    Retrieval process
    Public
    Protected
    Private
    PublicRead/WriteWrite-onlyWrite-only
    ProtectedRead-onlyProtectedProtected
    PrivateRead-onlyProtectedPrivate
  • Use of a class derived from a class with inheritance public:
    Assignment process
    /
    Retrieval process
    Public
    Protected
    Private
    PublicRead/WriteRead/WriteWrite-only
    ProtectedRead/WriteRead/WriteWrite-only
    PrivateRead-onlyRead-onlyPrivate
  • Using a class with protected inheritance:
    Assignment process
    /
    Retrieval process
    Public
    Protected
    Private
    PublicProtected inheritanceProtected inheritanceProtected inheritance
    ProtectedProtected inheritanceProtected inheritanceProtected inheritance
    PrivateProtected inheritanceProtected inheritanceProtected inheritance
  • Use of a class derived from a class with protected inheritance:
    Assignment process
    /
    Retrieval process
    Public
    Protected
    Private
    PublicRead/WriteRead/WriteWrite-only
    ProtectedRead/WriteRead/WriteWrite-only
    PrivateRead-onlyRead-onlyPrivate
  • Using a class with private inheritance:
    Assignment process
    /
    Retrieval process
    Public
    Protected
    Private
    PublicPrivate inheritancePrivate inheritancePrivate inheritance
    ProtectedPrivate inheritancePrivate inheritancePrivate inheritance
    PrivatePrivate inheritancePrivate inheritancePrivate inheritance
  • Use of a derived class with private inheritance:
    Assignment process
    /
    Retrieval process
    Public
    Protected
    Private
    PublicPrivate inheritancePrivate inheritancePrivate inheritance
    ProtectedPrivate inheritancePrivate inheritancePrivate inheritance
    PrivatePrivate inheritancePrivate inheritancePrivate inheritance
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help