Changes between Initial Version and Version 1 of CsMapRfc6


Ignore:
Timestamp:
07/24/12 07:10:31 (12 years ago)
Author:
baertelchen
Comment:

First draft of RFC 6

Legend:

Unmodified
Added
Removed
Modified
  • CsMapRfc6

    v1 v1  
     1= CS-Map RFC 6 - Separate "user-edited definitions" from "system definitions" in CSD files =
     2
     3This page contains an change request (RFC) for the CS-Map Open Source project.
     4More CS-Map RFCs can be found on the [wiki:CsMapRfcs RFCs] page.
     5
     6
     7== Status ==
     8
     9||RFC Template Version||(1.0)||
     10||Submission Date||||
     11||Last Modified||(Andre) [[Timestamp]]||
     12||Author||(Andre)||
     13||RFC Status||(draft)||
     14||Implementation Status||||
     15||Proposed Milestone||||
     16||Assigned PSC guide(s)||||
     17||'''Voting History'''||||
     18
     19== Overview ==
     20
     21CS-MAP’s “geodetic database” is a set of 6 binary catalog (*.CSD) files. These are created out of a set of *.ASC files by the CS_comp.exe compiler tool.
     22By default, all definitions entries generated by this tool are write-protected. However, custom definitions can be added to the files. That is, "system definitions" and "customized definitions" are contained in the same file(s).
     23
     24This RFC is to add capabilities to CS-MAP, so that custom(ized) definitions are no longer being written into the files produced by CS_comp.exe but are rather kept separated if required by the application hosting CSMAP.lib.
     25
     26
     27== Motivation ==
     28
     29Mixing customized definitions with system definitions in 1 file nowadays leads to several problems:
     30 * Sharing customized CS information typically requires sharing entire CSD files.
     31 * Backing up customized definitions requires backing up all CSD files.
     32 * Writing clean installer scripts is more difficult.
     33 * File system privileges are more difficult to administer.
     34
     35
     36
     37Users required to work with customized definitions have to be given write access to files which typically should be accessible by system administrators only.
     38
     39
     40Applications would benefit from the change proposed by this RFC in the following way:
     41 * Sharing customized CS information becomes way easier. One would only have to share all or a subset of the *.CSD files from the user defined path.
     42No additional tool required that would extract / import customized definitions.
     43 * Backing-up user-defined dictionaries becomes simpler.
     44 * Writing clean installers (scripts) is less difficult. If customized definitions were separated from the system definitions, installer scripts could remove all previously installed files without having to include additional logic to handle modified *.CSD files.
     45 * Applications can more easily be upgraded to a new version of CS-MAP and dictionaries.
     46
     47
     48== Proposed Solution ==
     49
     50CS-MAP has its very own “definition protection schema” which can be controlled by application hosting CS-MAP. In principle, all definitions found in a *.CSD file are either...:
     51 * Completely unprotected (must be enabled by the application): That is, even definitions created by the CS_comp.exe tool can be changed.
     52 * Only system definitions are protected (default): Only definitions created by the CS_comp.exe tool are protected
     53 * Custom definitions become protected: System definitions are protected. In addition, customized definitions become protected after a given amount of days where no modifications were made.
     54
     55
     56The proposed solution is to keep all aforementioned behavior but allow the hosting application to set a directory where all customized definitions should be stored in.
     57In short, the following implementation would be affected:
     58 * Provide new CS_usrdir() API.[[BR]]
     59This would have to exist in addition to the CS_altdir() API. If set, CS-MAP will store all custom definitions in that directory.
     60New files will be created by CS-MAP, if not yet existing.
     61 * Change all relevant IO API for all types of supported definitions, e.g. [CS_*def()], [CS_*rd()], [CS_*del], … to include the files, if found, from the directory set by [CS_usrdir()].
     62Note, that all that these methods, while implemented in separate C-Modules, all provide the same file IO functionality. In fact, most of the code is identical.
     63To ease porting all that code to the new behavior, this RFC also aims for implementing a C++ module which would be internal to CS-MAP.
     64That C++ module would centralize all relevant IO routines in templated functions and would expose its functionality through an “extern-C” wrapper module to CS-MAP.
     65CS-MAP already contains other CPP files, too.
     66 * Remove all code that might keep the COORDSYS.CSD, DATUM.CSD and ELIPSOID.CSD files open after 1st usage.
     67There should be one common behavior in how CS-MAP uses its *.CSD files – open, read/write, close. That schema has also been implemented for all new dictionary types.
     68
     69== Implications ==
     70
     71'''Behavioral changes:'''
     72
     73
     74None for current clients. Storing custom(ized) definitions in separate *.CSD files must be explicitly enabled via a call to the new [CS_usrdir()].
     75For clients wishing to use the new capabilities, all changes will be transparent. That is, all API like CS_*def() will start reading definition information from the user-provided dictionary path, and if nothing was found, will continue with the default set of *.CSD files.
     76
     77'''API removal:'''
     78
     79
     80Remove the following static variables from CSMAP and thus the option for an API client to specify how CSMAP would keep files open.
     81As aforementioned, CSMAP would now always close any *.CSD file right after having used it.
     82
     83
     84{{{
     85
     86csThread short cs_CsStrmFlg = FALSE;
     87csThread short cs_DtStrmFlg = FALSE;
     88csThread short cs_ElStrmFlg = FALSE;
     89 
     90csThread csFILE* cs_CsStream = 0;
     91csThread csFILE* cs_DtStream = 0;
     92csThread csFILE* cs_ElStream = 0;
     93
     94}}}
     95
     96API additions (public):
     97
     98
     99{{{
     100
     101CS_usrdir()
     102
     103}}}
     104
     105
     106
     107== Test Plan ==
     108
     109The following set of unit tests will be implemented:
     110 * Read
     111 * Add / Update
     112 * Delete
     113
     114== Funding/Resources ==
     115
     116Supplied by Autodesk.