Motivation: |
Improve quality and maintainability of jdbc data stores. |
|
|---|---|---|
Contact: |
||
Tracker: |
http://jira.codehaus.org/browse/GEOT-2056 | |
Tagline: |
|
This page represents the current plan; for discussion please check the tracker link above.
|
This proposal presents the plan to use a new set of support classes for jdbc based data stores. The motivation/benefits being:
In the current jdbc data store architecture a set of base classes (JDBCDataStore is subclassed for each implementation. Various methods are overridden to customize for each specific backend database.
In the new architecture, there is a single JDBCDataStore class, and in fact it is marked final to prevent subclassing. To customize for each data base implementation the notion of a "dialect" (taken from the hibernate architecture) is introduced.
The dialect interface encapsulates all the operations specific to a particular database implementation.
Elements of this proposal were committed to 2.6.x (and the former implementation should be slated for retirement in 2.7.x or 2.8.x):
Using the 5 start module rating system:
IP Check - Good to go. No missing headers. ![]()
Releasable - No blocking issues in JIRA. ![]()
Used - GeoServer trunk has moved to using jdbc=ng modules ![]()
Optimized - On par with old modules. ![]()
Supported - Well maintained, still lacks some user docs. ![]()
Rating = 4/5

Note: This is somewhat inaccurate since it only shows the test results of the non prepared statement path. So in actuality test coverage is higher. But regardless it meets the requirements.
|
no progress |
|
done |
|
impeded |
|
lack mandate/funds/time |
|
volunteer needed |
|---|
There are no api changes from the client point of view. The dialect api is a private api for developers, not for users. The regular datastore api remains uncahnged.
public class OracleDataStore extends JDBCDataStore {
...
//override getFeatureReader
public FeatureReader getFeatureReader(...) {
...
}
}
|
public final class JDBCDataStore {
//dialect
SQLDialect dialect;
public FeatureReader getFeatureReader( ... ) {
//boiler plate stuff
//bulid up sql, delegating to dialect for specifics
//run query and return a feature reader
}
}
|
Documentation for JDBC datstores will need to be updated for the new modules. Basically everything under:
http://docs.codehaus.org/display/GEOTDOC/11+JDBC
Currently all the new code lives in the unsupported module. And all the old code remains in library and plugin:
library/ jdbc/ plugin/ postgis/ db2/ unsupported/ jdbc-ng/ jdbc-core jdbc-h2/ jdbc-oracle/ jdbc-mysql/ jdbc-postgis/ |
The following module structure is proposed:
library/
jdbc/ (merged with what was unsupported/jdbc-ng/jdbc-core)
plugin/
jdbc/
jdbc-db2/
jdbc-h2/
jdbc-postgis/
jdbc-oracle/
unsupported/
postgis/
oracle/
|