Changes between Initial Version and Version 1 of MapGuideRfc21


Ignore:
Timestamp:
05/29/07 01:37:13 (18 years ago)
Author:
ksgeograf
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc21

    v1 v1  
     1= !MapGuide RFC 21 - Expose functionality for manipulating Runtime map, using Xml format =
     2
     3This page contains a change request (RFC) for the !MapGuide Open Source project. 
     4More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page.
     5
     6== Status ==
     7 
     8||RFC Template Version||(1.0)||
     9||Submission Date||May 7, 2007||
     10||Last Modified||Kenneth, GEOGRAF A/S [[Timestamp]]||
     11||Author||Kenneth, GEOGRAF A/S||
     12||RFC Status||draft||
     13||Implementation Status||pending||
     14||Proposed Milestone||1.3||
     15||Assigned PSC guide(s)||||
     16||'''Voting History'''||||
     17||+1||||
     18||+0||||
     19||-0||||
     20||-1||||
     21 
     22== Overview ==
     23
     24This RFC exposes some existing functionality as well as some new functionality for manipulating the runtime map.
     25
     26== Motivation ==
     27
     28The map definition is Xml based, and easy to manipulate. The runtime map is in binary format, and tightly tied to the inner workings of the MapGuide server. It should be expected that the current format will change over time, thus breaking compatibility with external binary reader/writer applications.
     29
     30When using the current MapGuide API, the code for creating and maintaining the runtime map is found in code shared by the server and the API. This means that an application must be adapted to fit a specific version of the MapGuide server. Or at least have the correct version of the codebase (eg. dll's).
     31
     32== Proposed Solution ==
     33
     34There already exists code in the server to create a runtime map from a map defintion.
     35There should be two more functions in the MgMap class:
     36{{{
     37void MgMap::UpdateRuntimeMap(MgResourceService* resourceService, MgResourceIdentifier* mapDefinition, CREFSTRING mapName);
     38void MgMap::UpdateMapDefinition(MgResourceService* resourceService, MgResourceIdentifier* mapDefinition, CREFSTRING mapName);
     39}}}
     40
     41The UpdateMapDefinition should just overwrite the mapDefinition with the current runtimemap.
     42The UpdateRuntimeMap should try to sync the runtime map, by settings map properties. This will allow the current change-list scheme to work.
     43
     44These two functions should be exposed in the HttpHandler, along with the existing MgMap::CreateMap(...).
     45
     46== Considerations ==
     47
     48This is prone to a race condition, as the client must get a copy of the runtime map, update it, and write it back. There is currently a generation scheme, at least with the Ajax viewer. This can be used to catch such problems.
     49
     50There may be an unwanted overhead, as the mapDefinition must be written to the server, resulting in the following scenario:
     51{{{
     52Call UpdateMapDefinition
     53Download MapDefinition
     54Modify map on client
     55Upload MapDefintion
     56Call UpdateRuntimeMap
     57}}}
     58
     59In some cases it might be more efficient to use these three variants:
     60{{{
     61void MgMap::UpdateRuntimeMap(MgResourceService* resourceService, MgByteReader* mapDefinitionAsXml, CREFSTRING mapName);
     62MgByteReader* MgMap::MapDefinitionFromRuntimeMap(MgResourceService* resourceService, CREFSTRING mapName);
     63void MgMap::CreateMap(MgResourceService* resourceService, MgByteReader* mapDefinitionAsXml, CREFSTRING mapName);
     64}}}
     65
     66Which could reduce the number of service calls from 4 to 2:
     67{{{
     68Call MapDefinitionFromRuntimeMap
     69Modify map on client
     70Call UpdateRuntimeMap
     71}}}
     72
     73== Implications ==
     74
     75This RFC is strictly an API enhancement. If the update to the runtime map, is done as a "diff" on the current map (as opposed to overwrite), there should be no compatibility problems. Any errors in this code, will effect only applications using this extension. Worst case would be a corrupted runtime map.
     76
     77== Test Plan ==
     78
     79Write a small test application that calls the functions through the HttpHandler. Should be very easy to test.
     80
     81== Funding/Resources ==
     82
     83Community contributed enhancement.