Property (programming)

From Wiki @ Karl Jones dot com
Revision as of 08:30, 4 September 2016 by Karl Jones (Talk | contribs) (Created page with "In some object-oriented programming languages, a '''property''' is a special sort of class member, intermediate between a Field (compute...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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