Property (programming)

From Wiki @ Karl Jones dot com
Jump to: navigation, search

In some object-oriented programming languages, a property is a special sort of class member, intermediate between a field (or data member) and a method.

Description

Properties are read and written like fields, but property reads and writes are (usually) translated to get and set method calls.

The field-like syntax is said to be easier to read and write than lots of method calls, yet the interposition of method calls allows for data validation, active updating (as of GUI visuals), or read-only 'fields'.

That is, properties are intermediate between member code (methods) and member data (instance variables) of the class, and properties provide a higher level of encapsulation than public fields.

See also

External links