Java Reference
In-Depth Information
Decision point
How does the data linker access the contents of the GIS database?
Class
DBConnector
(see Figure 15.10) plays the role of database proxy. It
implements a persistent layer that loads into memory the contents of the
GIS database and provides the data linker with access to the contents of
the thematic databases. It makes use of three ancillary classes. Class
DBListRecord
stores the values of a record extracted from tables
Databases
,
i.e. the description of a thematic database (e.g.
GIS.HistoricGeography
). Class
DBTableRecord
stores the values of a record extracted from table
Tables
, i.e.
the description of a table (e.g.
Routes
) belonging to the selected thematic
database. Class
DBValueRecord
stores the values of a record extracted from
the table identified by
DBTableRecord
, i.e. the description of route
Via Appia
.
15.5.3
Implementation
Classes
MapEntity
,
MapEntitySet
and
MapLayer
are extended with the data
structures that record the references to the tables and records in the
thematic databases and with the methods to store these references in an
XML file.
DBConnector
ArrayList keyList;
ArrayList labelList;
void openDatabase()
Iterator getDBList()
Iterator getTableList()
void loadTable()
DBValueRecord getRecord()
DBListRecord
DBTableRecord
DBValueRecord
int ID
String name
String description
long id;
long idDataBase;
String name;
String description;
String key;
String label;
ArrayList attributeList;
ArrayList typeList;
ArrayList valueList ;
Figure 15.10
The class diagram of the persistent layer