First page Back Continue Last page Overview Graphics

Getting Rid of Getters and Setter ...

but, but, but, but, … what about data encapsulation?

Solution:

Every attribute, which is needed by the users of the class, will be defined as a public attribute.

If we need data encapsulation at a later stage, we “redefine” the public attribute as a property.