CHAPTER 6 ■ OBJECTS AND DESIGN
104
In the object-oriented version, this choice about file format is made in the static getInstance()
method, which tests the file extension only once, serving up the correct subclass. The client code takes
no responsibility for implementation. It uses the provided object with no knowledge of, or interest in,
the particular subclass it belongs to. It knows only that it is working with a ParamHandler object, and that
it will support write() and read(). While the procedural code busies itself about details, the object-
oriented code works only with an interface, unconcerned about the details of implementation. Because
responsibility for implementation lies with the objects and not with the client code, it would ...