Nick

20%
Flag icon
Consider Listing 6-3 and Listing 6-4. The first uses concrete terms to communicate the fuel level of a vehicle, whereas the second does so with the abstraction of percentage. In the concrete case you can be pretty sure that these are just accessors of variables. In the abstract case you have no clue at all about the form of the data. Listing 6-3 Concrete Vehicle    public interface Vehicle {      double getFuelTankCapacityInGallons();      double getGallonsOfGasoline();    } Listing 6-4 Abstract Vehicle    public interface Vehicle {      double getPercentFuelRemaining();    } In both of the ...more
The Robert C. Martin Clean Code Collection (Collection) (Robert C. Martin Series)
Rate this book
Clear rating
Open Preview