[mapguide-users] Mapguide OpenSource 2.2 backward compatibility problem

Bruno Scott bscott at geomapgis.com
Fri Jun 4 02:42:53 EDT 2010


Hi All
We have a quite big MGOS application deployed on hundreds of different
clients
Most of them use MGOS 2.1 or MGE 2010 SP1
Some of them still use MGOS 2.0/1.2 or MGE 2010 / 2009
They will migrate to MGOS 2.2 or MGE 2011 but this process takes time so our
application
have to live in a multi version MGOS/MGE.

Now comes the problem with MGOS 2.2/MGE 2011
We use extensively the MgException::GetMessage() fonction
this function does not exist anymore because it is replaced by
GetExceptionMessage.
If we would only support MGOS 2.2/MGE 2011 it would be an easy fix.
Search and replace... (260 occurances in 79 files....)
But our code would not work in older MG anymore
the error comes at compile time, so pretty hard to catch
We are thinking of centralizing this call in a new internal function
  string MgGetExceptionMessage(MgException mgEx,string locale)
  {
    //if MGOS 2.2 or MGE 2011
    return mgEx.GetExceptionMessage(locale);
    //else
    //return mgEx.GetMessage();  
}
so this would simplify the code switching from 2.2/2011 to 2.1/2010
We would need to detect the MG version in our application setup
then switch this call from GetMessage to GetExceptionMessage

What would be the safest way (for an setup program) to detect the MG
version?
Thanks for your answer.
Bruno


by the way, it would have been a lot easier for us if would have kept the
GetMessage function
for backward compatibility





-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Mapguide-OpenSource-2-2-backward-compatibility-problem-tp5138292p5138292.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list