[mapserver-dev] Different WMS versions...
dgraham at i3.com
Tue Oct 1 11:58:58 EDT 2002
That is the right way to go about it. If mapserver was written in an
object oriented language, you would extend and override functions. You
would likely then create a factory to generate the correct version of
the object to execute the commands. Something like:
CapabilitiesDoc cd = CapablilitiesDocFactory.getDoc( Version v );
Not quite as graceful in C, but you can still capture some of the
concepts. Instead of a factory you might have a couple of high level
functions that route the code path to various sets of functions.
Another aproach in C is pass the function pointers. You can create a
function factory and pass back the function pointer required. But I
find this to be messy (that is why there is C++) and can be difficult to
maintain (especially if you were not the original devleoper).
Just some thoughts.
Steve Lime wrote:
>As we add new support for new versions of the OGC specs how should that
>be handled in the code? I was thinking, although verbose perhaps we
>should just make copies of the various functions that correspond to the
>version and then have the main handler check the version and hand off to
>the appropriate function. That might make the code easier to maintain
>long term since there wouldn't be tons of if-then statements to sort
>through. Easier to retire old version support as well since it would be
>seperated out nicely. I'm thinking specifically about the request to add
>WMS 1.1.1 getCapabilities.
>Data & Applications Manager
>500 Lafayette Road
>St. Paul, MN 55155
David W. Graham
Director of Geospatial Applications Development
information integration and imaging, LLC
201 Linden St, Third Floor
Fort Collins, CO 80524
dgraham at i3.com
More information about the mapserver-dev