On this page we will illustrate the principle of representation independence. It is done by discussion of a class Point which violates the principle. The class Point has public data representation (rectangular x and y coordinates). We assume that we need to change the rectangular coordinates to so-called polar coordinates (radius and angle). The consequences of this modification of the program is studied via the exercise.
Representation independence: Clients of the class C should not be affected by changes of C's data representation
Encapsulated data should always be hidden and private within the class
Read more about representation independence in the text book version of this material.