Properties and Events
Annual income twenty pounds, annual expenditure nineteen nineteen six, result happiness. Annual income twenty pounds, annual expenditure twenty pound ought and six, result misery.
—Charles Dickens, David Copperfield
Properties were created to provide field-like functionality for data in a context that allows the programmer to either access the data or abstract the data in an entirely different fashion than is provided by the type system.
Normal fields are simple type declarations within a class. A property contains a method for retrieving data called a getter, a method for storing data called a setter, or both ...