Nick

20%
Flag icon
Listing 6-2 Abstract Point    public interface Point {      double getX();      double getY();      void setCartesian(double x, double y);      double getR();      double getTheta();      void setPolar(double r, double theta);    } The beautiful thing about Listing 6-2 is that there is no way you can tell whether the implementation is in rectangular or polar coordinates. It might be neither! And yet the interface still unmistakably represents a data structure. But it represents more than just a data structure. The methods enforce an access policy. You can read the individual coordinates ...more
The Robert C. Martin Clean Code Collection (Collection) (Robert C. Martin Series)
Rate this book
Clear rating
Open Preview