| 1 | = !MapGuide RFC 61 - !GetSpatialContexts cleanup = |
| 2 | |
| 3 | This page contains a change request (RFC) for the !MapGuide Open Source project. |
| 4 | More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page. |
| 5 | |
| 6 | == Status == |
| 7 | |
| 8 | ||RFC Template Version||(1.0)|| |
| 9 | ||Submission Date||April 5, 2009|| |
| 10 | ||Last Modified||Steve Dang [[Timestamp]]|| |
| 11 | ||Author||Steve Dang|| |
| 12 | ||RFC Status||draft (draft, proposed, frozen for vote, adopted, retracted, or rejected)|| |
| 13 | ||Implementation Status||pending (pending, under development, completed)|| |
| 14 | ||Proposed Milestone||2.2|| |
| 15 | ||Assigned PSC guide(s)||Tom Fukushima|| |
| 16 | ||'''Voting History'''||(vote date)|| |
| 17 | ||+1|| || |
| 18 | ||+0|| || |
| 19 | ||-0|| || |
| 20 | ||-1|| || |
| 21 | ||no vote|| || |
| 22 | |
| 23 | == Overview == |
| 24 | |
| 25 | This RFC is to deprecate the Spatial Context active flag that is obsolete and no longer in use by: |
| 26 | |
| 27 | * The !GetSpatialContexts API (to retrieve the spatial contexts in the feature source). |
| 28 | * The !MgSpatialContextReader class (to retrieve the spatial context data). |
| 29 | |
| 30 | == Motivation == |
| 31 | |
| 32 | * Make the !GetSpatialContexts API consistently reliable across all providers. |
| 33 | * Clean up legacy code and make existing code more readable. |
| 34 | * Reduce memory usage and improve performance in the Feature Service cache which only needs to save all of the spatial contexts available in the feature source. |
| 35 | |
| 36 | == Proposed Solution == |
| 37 | |
| 38 | * Add a new !GetSpatialContexts API to the Feature Service: |
| 39 | |
| 40 | {{{ |
| 41 | /////////////////////////////////////////////////////////////////////////// |
| 42 | /// \brief |
| 43 | /// Gets all of the spatial contexts available in the feature source. |
| 44 | /// |
| 45 | /// \remarks |
| 46 | /// The \link FdoSpatialContextList_schema FdoSpatialContextList \endlink XML schema contains |
| 47 | /// a specification of the content of the spatial context |
| 48 | /// information returned in the MgSpatialContextReader object. |
| 49 | /// |
| 50 | /// <!-- Syntax in .Net, Java, and PHP --> |
| 51 | /// \htmlinclude DotNetSyntaxTop.html |
| 52 | /// virtual MgSpatialContextReader GetSpatialContexts(MgResourceIdentifier resource); |
| 53 | /// \htmlinclude SyntaxBottom.html |
| 54 | /// \htmlinclude JavaSyntaxTop.html |
| 55 | /// virtual MgSpatialContextReader GetSpatialContexts(MgResourceIdentifier resource); |
| 56 | /// \htmlinclude SyntaxBottom.html |
| 57 | /// \htmlinclude PHPSyntaxTop.html |
| 58 | /// virtual MgSpatialContextReader GetSpatialContexts(MgResourceIdentifier resource); |
| 59 | /// \htmlinclude SyntaxBottom.html |
| 60 | /// |
| 61 | /// \param resource (MgResourceIdentifier) |
| 62 | /// A resource identifier identifying a feature source in the repository. |
| 63 | /// |
| 64 | /// \return |
| 65 | /// Returns an MgSpatialContextReader object. |
| 66 | /// |
| 67 | /// \exception MgFeatureServiceException |
| 68 | /// \exception MgInvalidArgumentException |
| 69 | /// \exception MgInvalidOperationException |
| 70 | /// \exception MgFdoException |
| 71 | /// |
| 72 | virtual MgSpatialContextReader* GetSpatialContexts(MgResourceIdentifier* resource) = 0; |
| 73 | }}} |
| 74 | |
| 75 | * Replace calls to the old !GetSpatialContexts API with the new ones. |
| 76 | * Update existing code to discontinue usages of the obsolete Spatial Context active flag where applicable. |
| 77 | |
| 78 | == Implications == |
| 79 | |
| 80 | * The following APIs will be deprecated in the future, and therefore, should be avoided to be used: |
| 81 | |
| 82 | {{{ |
| 83 | virtual MgSpatialContextReader* MgFeatureService::GetSpatialContexts(MgResourceIdentifier* resource, bool activeOnly) = 0; |
| 84 | |
| 85 | bool MgSpatialContextReader::IsActive(); |
| 86 | }}} |
| 87 | |
| 88 | * The documentation will be updated accordingly. |
| 89 | |
| 90 | == Test Plan == |
| 91 | |
| 92 | * The old !GetSpatialContexts API should work as before. |
| 93 | * Existing unit tests will be updated to utilize the new !GetSpatialContexts API and re-tested. |
| 94 | |
| 95 | == Funding/Resources == |
| 96 | |
| 97 | Autodesk |