Figure 3.1: UML-Diagram of Resulting Design
The final refactorings I make, are to change DatabaseFormat methods from static ones to normal instance methods. By adding a static getInstance() that is able to return single instances of different subclasses of DatabaseFormat I create an access point to the class. Two of those subclasses are created. One for the Progress DBMS the other for Oracle that provide the different syntaxes needed for producing correct SQL statements for those databases. They just overwrite those methods of DatabaseFormat that have to produce different results (see A.3, p.).
The database server now uses a parameter supplied in the configuration file to determine which database it is connected to and gets the according instance of DatabaseFormat by using the getInstance() method.
The resulting structure is shown at the UML diagram of the concerned classes (see 3.1, p.), which is created using JRefactory (see 2.3.2, p.) on the package and by hiding the unwanted classes under the margin.