Hi all,
As many of you know we have managed to find funding for wfs 2.0 in geoserver. Work has commenced and I wanted to run a few high level architecture decisions by the group for feedback.
When it comes to ows services (with multiple versions) in geoserver there are two ends of a spectrum. One end is that the two service versions are relatively similar and not much changes. The other end is that the two are radically different. An example of the former is wfs 1.0 → 1.1. An example of the latter is wcs 1.0 → wcs 1.1.
Now… wfs 1.1 → 2.0 is somewhat in the middle of the spectrum. The changes are significant but the core of the service is still relatively the same. The degree of changes impacts a number of decisions, the first one we run up against is the request object model to use. For instance, since wfs 1.0 and 1.1 were so much the same we just generated an object model based on the wfs 1.1 schema, and had both service versions us that. But for wcs the schemas were just too radically different so each service has its own object model.
Looking over the spec I think that the changes in wfs 2.0 are enough to warrant its own object model. Which brings up a problem. The existing wfs operations (which have a lot of logic we need to reuse) are written against the old model. The solution I have come up with thus far is to create a level of indirection between the request object model and the operations that use them. This level of indirection, which i am calling RequestObjectHandler, basically encapsulates the details of accessing the object model with an implementation for the 1.0/1.1 model and an implementation for the 2.0 model.
My first cut at this class can be found here:
And if you look at say one of the operation classes, like GetFeature, it now has an additional constructor to take an instance of the request object handler.
https://github.com/jdeolive/geoserver/blob/wfs2/wfs/src/main/java/org/geoserver/wfs/GetFeature.java
Thoughts and feedback or an alterative approach are all welcome. Having to access all request object properties through the handler is somewhat tedious… but seemed like a better approach then trying to duplicate or refactor the operation classes.
-Justin
–
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.