[prev] [index] [next]

Example: Point Data Type (cont)

Point is not an ADT because representation is known

If we changed representation to polar, e.g.

typedef struct { d float; theta float; } Point;

we would need to change the client (which assumes e.g. p.x)

ADTs allow implementer to change implementation without clients needing any change (except recompilation).

This is an extremely useful software engineering property.