Java Reference
In-Depth Information
CHALLENGE 6.2
Draw a diagram that shows the relationships among the classes JDBCAdapter ,
OzJDBCAdapter , NoQuery , and Statement .
The JDBC architecture clearly divides the roles of the driver writer and the application writer.
In some cases, this division will not exist in advance, even if you are using drivers. You may
be able to set up drivers as subclasses of an abstract superclass, with each subclass driving a
different subsystem. In such a case, you can be forced to set up a B RIDGE when you need
more flexibility.
Refactoring to Bridge
Sometimes, you have to refactor an abstract class into a B RIDGE to gain more flexibility in the
abstraction. Consider the MachineController hierarchy at Oozinoz. Other than database
drivers, the most common application of drivers is to operate external devices. These devices
may be peripherals, such as printers and pen plotters, or any machine capable of
communicating with computers. Applications at Oozinoz control most of the machines on
the factory floor with the drivers, or controllers, that Figure 6.4 shows.
Search WWH ::




Custom Search