| 49 | In the above example, "OSGeo.SDF.5.0" is returned when "OSGeo.SDF" is requested. However, suppose that this provider is compatible with FDO version 5.0 and the version of FDO, used by the client, is 4.0. When there is a major version number difference then there is a good chance that the provider is binary incompatible with FDO, meaning that a crash or exception will occur when the provider is loaded. |
| 50 | |
| 51 | ==== Config File Versions ==== |
| 52 | |
| 53 | FDO provides the ability to serialize datastore contents to the FDO XML format. This includes feature schemas, spatial contexts, logical/physical mappings (Schema Overrides) and the features themselves. FDO XML format data can be stored in a file. The FDO XML format can change between major FDO revisions so there are versioning issues surrounding these files. These are mainly compatibility issues that arise when a file is written by one version of FDO and read by another. |
| 54 | |
| 55 | In order for a particular version of FDO to determine if it can read a file, it needs to know what version of FDO created the file. Therefore, the file must contain this version information. The following sections discuss the versioning requirements for each type of serializable object. |
| 56 | |
| 57 | ===== Feature Schemas ===== |
| 58 | |
| 59 | Feature Schemas are currently written to XML without FDO version information. This version information needs to be added, going forward, in case the XML format for Feature Schemas changes in future. When a particular version of FDO reads a feature schema from a config file, it may need to know this version in order to read it properly. |
| 60 | |
| 61 | ===== Spatial Contexts ===== |
| 62 | |
| 63 | Similarly, Spatial Contexts are written to XML without FDO version information. This version information need to be added, going forward. |
| 64 | |
| 65 | ===== Schema Overrides ===== |
| 66 | |
| 67 | Schema Overrides are written to XML with FDO versioning information. The overrides include the name, major version and minor version of the provider that wrote them. |
| 68 | |
| 69 | The main requirement is to make sure that, when Schema Overrides are read from XML, they are parsed into objects that are binary compatible with the current FDO. |
| 70 | |
| 71 | When FDO reads a Schema Override Set from XML, it delegates the reading to the provider that wrote the overrides. Schema Overrides are provider-specific, so only the provider knows how to read or write them. Currently, FDO chooses the earliest version of the provider that is equal to or greater than the version of the Schema Override set. However, it is possible for the chosen provider to be binary-incompatible with the current FDO. This means that the provider may either fail to be instantiated or it may parse the Schema Overrides into objects not compatible with the current FDO. |
| 72 | |
| 73 | ===== Features ===== |
| 74 | |
| 75 | Features are written to XML without FDO version information. This version information needs to be added, going forward. |
| 76 | |
| 77 | === Feature Specification === |
| 78 | |
| 79 | The following describes the client-visible changes proposed by this design. |
| 80 | |
| 81 | ==== FDO API ==== |
| 82 | |
| 83 | ===== FdoFeatureAccessManager::GetFeatureDataObjectsVersion ===== |
| 84 | |
| 85 | When this function is called it will return the version of the feature data objects specification that the currently loaded Feature Access Manager supports. The version number string has the form [!VersionMajor].[!VersionMinor].[!BuildMajor].[!BuildMinor]. |
| 86 | |
| 87 | The function signature shall be: |
| 88 | |
| 89 | {{{ |
| 90 | FDO_API static FdoString* GetFeatureDataObjectsVersion(); |
| 91 | }}} |
| 92 | |
| 93 | ===== FdoConnectionManager::CreateConnection() ===== |
| 94 | |
| 95 | When this function is passed a provider name without version part (e.g. "OSGeo.SDF" ), it returns a connection object from the latest registered version of that provider. |
| 96 | |
| 97 | With this proposal, the provider chosen will be the provider with the latest binary-compatible !FeatureDataObjects version. |
| 98 | |
| 99 | The connection object will be instantiated from the chosen provider. If there is no compatible registered provider then !CreateConnection will return NULL. |
| 100 | |
| 101 | For the above provider searches, the provider's !FeatureDataObjects version will be used instead of the provider version itself. The reason for this is that the !FeatureDataObjects version is the one that corresponds to the version of the FDO core. |
| 102 | |
| 103 | The provider search behaviour is unchanged when the requested provider name contains version parts. In this case, the latest provider matching these version parts is chosen. However, in these cases, the client assumes the risk that the returned connection object may be incompatible with the current FDO. |
| 104 | |
| 105 | It is expected that most clients will pass in a provider name without version parts, since they would usually be interested in retrieving a binary-compatible version of the requested provider. |
| 106 | |
| 107 | A provider is considered to be binary-compatible with the current FDO if the specified parts of the provider's !FeatureDataObjectsVersion match those of the current version of FDO. For example, if the !FeatureDataObjectsVersion has 2 parts, then these must match the 1st 2 parts of the current FDO's version. The following table provides some concrete examples: |
| 108 | |
| 109 | '''Provider !FeatureDataObjectsVersion''' |
| 110 | |
| 111 | 3 |
| 112 | |
| 113 | ''Compatible versions of FDO core'' |
| 114 | |
| 115 | 3.0.0.0[[br]] |
| 116 | 3.1.0.0[[br]] |
| 117 | 3.2.0.1[[br]] |
| 118 | |
| 119 | ''Incompatible FDO versions'' |
| 120 | |
| 121 | 2.0.0.0[[br]] |
| 122 | 4.0.0.0[[br]] |
| 123 | 4.1.0.0[[br]] |
| 124 | |
| 125 | '''Provider !FeatureDataObjectsVersion''' |
| 126 | |
| 127 | 3.0 |
| 128 | |
| 129 | ''Compatible versions of FDO core'' |
| 130 | |
| 131 | 3.0.0.0[[br]] |
| 132 | 3.0.1.0[[br]] |
| 133 | |
| 134 | ''Incompatible FDO versions'' |
| 135 | |
| 136 | 2.0.0.0[[br]] |
| 137 | 3.1.0.0[[br]] |
| 138 | 3.2.0.0[[br]] |
| 139 | |
| 140 | '''Provider !FeatureDataObjectsVersion''' |
| 141 | |
| 142 | 3.2 |
| 143 | |
| 144 | ''Compatible versions of FDO core'' |
| 145 | |
| 146 | 3.2.0.0[[br]] |
| 147 | 3.2.1.0[[br]] |
| 148 | |
| 149 | ''Incompatible FDO versions'' |
| 150 | |
| 151 | 3.1.0.0[[br]] |
| 152 | 3.1.1.0[[br]] |
| 153 | 3.3.0.0[[br]] |
| 154 | |
| 155 | '''Provider !FeatureDataObjectsVersion''' |
| 156 | |
| 157 | 3.1.0.1 |
| 158 | |
| 159 | ''Compatible versions of FDO core'' |
| 160 | |
| 161 | 3.1.0.1 |
| 162 | |
| 163 | ''Incompatible FDO versions'' |
| 164 | |
| 165 | 3.1.0.0[[br]] |
| 166 | 3.1.0.2[[br]] |
| 167 | 3.1.2[[br]] |
| 168 | |
| 169 | |