Access privileges for class members in Delphi XE (new strict private and strict protected, and automated)

Source: Internet
Author: User

Access rights for class members in the Delphi XE
A total of 6 keywords are provided to restrict access:
Public, private, protected, published, automated strict private, strict protected
Their respective meanings are:

1. Strict private:
The field or method defined by this zone can only be used in the current class. That is, members of this zone definition in T1 can only be used in T1.
2. Strict protected:
The member defined by this zone can be used in addition to the current class, and can also be used in any subclass of the current class. Both of these members cannot be accessed between different objects of the same class.
3. Private:
Qualified members can only be used to define the. pas file or. dpr file for this class.
4. Protected:
The equivalent of extending private to any subclass is visible.
5. Public:
Visible to any location, any class. When some members do not explicitly specify their access rights, Delphi defaults to this public.
6. Published:
Access rights are the same as public.
7. Automated:
Used for COM programming under WIN32.

Note: The strict private and strict protected are introduced from Delphi2007, and the previous version does not exist in either of these levels

The following two points should be noted when declaring attributes in the published published published zone:
The value of the published published property can only be: an ordered type, a string interface variant method pointer, and a collection type between 0 and 31 on the upper bound. A real number cannot be a Real48 type.
Two or more overloaded methods cannot be advertised in the same name.

http://blog.csdn.net/shuaihj/article/details/6187814

Access privileges for class members in Delphi XE (new strict private and strict protected, and automated)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.