[mapguide-internals] RE: Initial review on RFC90 code

Trevor Wekel trevor_wekel at otxsystems.com
Mon May 3 08:47:34 EDT 2010

Hmm... I wonder if my tone was a little strong for the review.  If it was, I apologize.

UV, if you have time, it would be great if you could provide me with some feedback on the review.  The PSC was hoping to get RFC 90 into MapGuide 2.2 but the beta is already a month late.


-----Original Message-----
From: Trevor Wekel 
Sent: April 27, 2010 12:10 PM
To: 'MapGuide Internals Mail List'
Subject: Initial review on RFC90 code

Hi UV,

Here are some comments from my initial review of the RFC 90 code.  I will do a follow up review once the RFC has been updated and code changes have been made.

Thank you,

General Comments

RFC 90 documentation in Trac is incomplete.  All serverconfig.ini parameters and new function signatures should be documented.  A general algorithm overview would also be good.

Based on my initial review, the following items should be documented:
- useMetaTiles and LockMethod serverconfig.ini parameters.
- Behavioural modification to AGGRenderer::Save and AGGImageIO.cpp
- New MgTileCache behaviour (see below, I believe some refactoring would be appropriate)

File specific comments

- new RenderFromMetaTile signature commented out, should it be removed?

- space change is not necessary.

- TileServicePropertyUseMetaTiles, TileServicePropertyLockMethod should be doc'd in RFC.
- New properties should be added to MgConfigProperties::sm_cviTileServiceProperties array

- "META" image format could be defined in MgImageFormats as an INTERNAL_API
- new ::SaveMethod uses format = "META".  I am not 100% clear on how this all fits together.  Some algorithm documetation in the RFC would be helpful.
- Can assert be replaced by a throw (MgInvalidArgumentException)?

- Please remove commented out code.

- Why were "Static" configurations added?

- Rendering Service should not depend on Tile service headers.

- GetTileCoords()
What purpose does tileColOffset serve?
Could this method be moved into MgMap as an INTERNAL_API method which takes tileWidth and tileHeight as parameters?

- RenderTileFromMetaTile()
Can asserts be replaced by MgInvalidArgumentException, MgOutOfRangeException?
Should bsimp->GetLength() be tested for 0 < size < 2^31 before casting?
Why is MyByteSource required?  The direct cast is fragile.

- RFC documentation for sm_creationCutoffTime, sm_pollingInterval, sm_useMetaTiles, sm_lockMethod

- sm_creationCutoffTime and sm_pollingInterval should use same time base.

- MgServerTileService::MgServerTileService() : MgTileService()
METAMAXDIM should be moved to configuration parameters MG_CONFIG_MAX_METATILE_DIM
Error message should use MgConfigurationPropertyValueIsOutOfRange
<sstream> use could be dropped. 

- DetectLockFile()
This functionality should be moved into MgTileCache and probably renamed to WaitForTileLock.
Is a subsecond sleep really necessary?
ACE_OS::sleep (const ACE_Time_Value &tv) may simplify code

- GetTile()
Since there is no signature change to the public API, APIVERSION 1.2 is not really required.

- GetSingleTile()
MgFoundBlockingLockFile must be added to resource string file(s) in MapGuideCommon/Resources

- GetMetaTile()
Locking methods should be documented in the RFC.
Algorithm can be simplified by only generating a lock for the left top corner.  Meta tiling will be always on or always off.  For future work, each map will also be meta tiled or not.
I believe there is too much special case locking logic coded here.  The locking logic should be moved into MgTileCache (LockTile(), UnlockTile(), WaitForTileLock()).
All error messages must be defined in MapGuideCommon/Resources
<sstream> use could be dropped.

- GetLockMap()
Lock map structure should not be directly exposed using GetLockMap().  LockTile() and UnlockTile() methods should be added.  New methods should hide sm_lockMethod details from the rest of the code.

- Font names seem to have changed.  Please check editor.

More information about the mapguide-internals mailing list