[mapserver-dev] Different WMS versions...

Daniel Morissette morissette at dmsolutions.ca
Tue Oct 1 14:12:21 EDT 2002


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.
> 

I agree that the if/then statements may not be the nicest way to do
things from a software engineering point of view, but since the
differences between versions are usually small I think it's still the
best option.  Having one set of function for each version of the spec
would mean tons of code duplication which means harder maintenance in my
opinion.  Since over 95% of the code would be identical between
versions, I think if/then statements is still the best compromise unless
we rewrite the whole WMS capabilities thing to use a XML generator tool
or something better than the current printf-based XML capabilities
function.

The current code already implements 1.0.0, 1.0.7 and 1.1.0 using if/then
statements, so adding 1.1.1 shouldn't be too hard since all we need to
do is account for the differences between 1.1.0 and 1.1.1 and this is
quite small unless I missed something (I think the main difference that
would affect us is the way SRS tags work).  The worst revision was
between 1.0.7 and 1.1.0 but this is already handled.

My 0.02$

Daniel
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.



More information about the mapserver-dev mailing list