Changes between Version 20 and Version 21 of FDORfc23
- Timestamp:
- 07/18/08 10:04:03 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FDORfc23
v20 v21 1 = FDO RFC 23 - New !GetSchemaNames, !GetClassNames , and !DescribeClasses commands=1 = FDO RFC 23 - New !GetSchemaNames, !GetClassNames commands, and !DescribeSchema hint = 2 2 3 3 This page contains a request for change document (RFC) for the FDO Open Source project. … … 34 34 == Proposed Solution == 35 35 36 The performance gain from using the new !GetSchemaNames , !GetClassNames, and !DescribeClasses commands will be most notable for the RDBMS-based FDO providers. Support for the commands will be indicated by the provider's command capabilities object. Hence, only the RDBMS-based FDO providers will include !FdoCommandType_GetSchemaNames, !FdoCommandType_GetClassNames, and !FdoCommandType_DescribeClasses in the !GetCommands() response when interrogating the provider's capabilities.36 The performance gain from using the new !GetSchemaNames and !GetClassNames commands, and the modified !DescribeSchema command will be most notable for the RDBMS-based FDO providers. Support for the new commands will be indicated by the provider's command capabilities object. Hence, only the RDBMS-based FDO providers will include !FdoCommandType_GetSchemaNames, and !FdoCommandType_GetClassNames in the !GetCommands() response when interrogating the provider's capabilities. Likewise, the new behaviour in !DescribeSchema will be supported in the RDBMS-based providers. For all the non-RDBMS based providers, there will not be any change in the execution of the !DescribeSchema command. 37 37 38 38 === !GetSchemaNames === … … 107 107 }}} 108 108 109 === !DescribeClasses === 110 111 To retrieve specific class definitions, a new command !DescribeClasses will be added to the API for obtaining a schema containing the class collection for only the requested classes. If the command has set the schema to retrieve, the classes set by !SetClassNames will be restricted to that schema. If no schema has been set, fully qualified class names should be passed to the !SetClassNames method. Finally, if the schema has not been set, and class names are not fully qualified, then the result will contain all matching class names. An exception will be thrown if the schema name specified in both the schema name and qualified class name parameter do not match. 109 === !DescribeSchema === 110 111 To retrieve specific class definitions, the existing !DescribeSchema command will be modified to allow specifying the classes contained in the class collection of the resulting schema. In particular, a new method !SetClassNames will be added to the command to facilitate the request for a collection of certain classes. If the command has set the schema to retrieve, the classes set by !SetClassNames will be restricted to that schema. If no schema has been set, fully qualified class names should be passed to the !SetClassNames method. Finally, if the schema has not been set, and class names are not fully qualified, then the result will contain all matching class names. An exception will be thrown if the schema name specified in both the schema name and qualified class name parameter do not match. 112 113 Since this change involves an update to the !DescribeSchema command interface, implementation of the !SetClassNames method will be mandatory for all providers. However, due to resource constraints and the cost versus benefit of restricting the results to certain classes for each provider, it is proposed that the class names passed to this method serve as a hint for the !DescribeSchema command during execution. Providers will not necessarily take advantage of the hint, depending on each provider's criteria and implementation schedule, and simply return the full schema. There would not be any capability exposed to advertise support for the new behaviour, and no error or exception thrown if the provider does not intend to use the hint. Initially the RDBMS-based providers will use the hint and restrict the returned schema to the specific classes, since those providers should exhibit performance improvements when the full schema does not need to be returned. 112 114 113 115 {{{ 114 116 /// \brief 115 /// The FdoIDescribeClasses interface defines the DescribeClasses command, which 116 /// describes specific classes available for a particular schema. The DescribeClasses 117 /// command can describe multiple classes that are available from the connection. 118 /// The Execute operation returns an FdoFeatureSchemaCollection object. 119 class FdoIDescribeClasses : public FdoICommand 117 /// The FdoIDescribeSchema interface defines the DescribeSchema command, which 118 /// describes the feature schemas available from the connection. The DescribeSchema 119 /// command can describe a single schema or all schemas available from 120 /// the connection. The Execute operation returns an FdoFeatureSchemaCollection 121 /// object. 122 class FdoIDescribeSchema : public FdoICommand 120 123 { 121 124 friend class FdoIConnection; … … 123 126 public: 124 127 /// \brief 125 /// Gets the name of the schema that the command will be restricted to. 126 /// This function is optional; if not specified, execution of the command will 127 /// describe requested classes using the qualified class name. If the class name 128 /// is not qualified, the requested class from all schemas will be described. 128 /// Gets the name of the schema to describe. This function is optional; 129 /// if not specified, execution of the command will describe all schemas. 129 130 /// 130 131 /// \return … … 134 135 135 136 /// \brief 136 /// Sets the name of the schema that the command will be restricted to. 137 /// This function is optional; if not specified, execution of the command will 138 /// describe requested classes using the qualified class name. If the class name 139 /// is not qualified, the requested class from all schemas will be described. 137 /// Sets the name of the schema to describe. This function is optional; if not 138 /// specified execution of the command will describe all schemas. 140 139 /// 141 140 /// \param value … … 150 149 /// Gets the names of the classes to retrieve. This is optional, 151 150 /// if not specified execution of the command will describe all classes. 151 /// If the class name is not qualified, and the schema name is not specified, 152 /// the requested class from all schemas will be described. 153 /// The class names specified serve only as a hint. Use of the hint 154 /// during command execution is provider dependent. Providers that 155 /// will not use the hint will describe the schema for all classes. 152 156 /// 153 157 /// \return … … 159 163 /// Sets the name of the classes to retrieve. This is optional, if not 160 164 /// specified execution of the command will describe all classes. 165 /// If the class name is not qualified, and the schema name is not specified, 166 /// the requested class from all schemas will be described. 167 /// The class names specified serve only as a hint. Use of the hint 168 /// during command execution is provider dependent. Providers that 169 /// will not use the hint will describe the schema for all classes. 161 170 /// 162 171 /// \param value … … 169 178 170 179 /// \brief 171 /// Executes the DescribeClasses command and returns a 172 /// FdoFeatureSchemaCollection. If the specified schema name or a class name does not exist, 180 /// Executes the DescribeSchema command and returns a 181 /// FdoFeatureSchemaCollection. If a schema name is given that has 182 /// references to another schema, the dependent schemas will 183 /// be returned as well. If the specified schema name does not exist, 173 184 /// the Execute method throws an exception. 174 185 /// 175 186 /// \return 176 /// Returns the schema collection representing the schema containing 177 /// the class collection for the specified classes. 187 /// Returns the schema collection representing the schema created. 188 /// The element states for all elements will be set to FdoSchemaElementState_Unchanged. 189 /// Each provider-specific implementation of Execute() can ensure 190 /// that this is the case by 191 /// calling FdoFeatureSchema::AcceptChanges() for each feature schema 192 /// in the returned collection. 178 193 /// 179 194 FDO_API virtual FdoFeatureSchemaCollection* Execute() = 0; … … 184 199 === Discussion of Alternate Approach (but not proposed as part of this RFC) === 185 200 186 An alternative solution that does not create the new !DesribeClasses command, is to modify !DescribeSchema to allow the results to be filtered by class names, making it a fundamental part of the command. There would not be any capability exposed to advertise support for the new behaviour, so updating all providers becomes mandatory. Although this approach makes for a cleaner API experience in terms of !DescribeSchema usage and consistency amongst all providers, there are some issues which makes the feasibility of this approach unsuitable at this time.201 An alternative solution is to modify !DescribeSchema to make filtering of the schema by class names a fundamental part of the command, requiring all providers to have full implementation for the new behviour. Although this approach makes for a cleaner API experience in terms of !DescribeSchema usage and consistency amongst all providers, there are some issues which makes the feasibility of this approach unsuitable at this time. 187 202 188 203 1. Not all providers would benefit from the new behaviour in !DescribeSchema. The main benefit would be the responsiveness of the command for the RDBMS providers. Some of the file-based providers may also benefit, but if caching is used there may not be any significant improvement. As such, it would not be worth the effort to implement in all providers when there is little to no gain. The solution to this should include optional implementation on an as-needed basis. … … 192 207 3. Resources for implementing in all providers is limited for all concerned parties. Since implementation of the !DescribeSchema changes is not optional, this may create undue strain on available resources for all interested parties. 193 208 194 By favouring optional implementation of the new !DescribeClasses command over mandatory implementation of changes to the existing !DescribeSchema command, the effort can be focused on where it is needed most. It also allows flexibility for the other providers to determine if and when the new commandshould be implemented based on their own criteria.209 By favouring optional use a hint to restrict classes in !DescribeSchema over mandatory implementation of support for class filtering, the effort can be focused on where it is needed most. It also allows flexibility for the other providers to determine if and when use of the hint should be implemented based on their own criteria. 195 210 196 211 == Implications == … … 198 213 Application code that currently uses !DescribeSchema to enumerate schema/class names or retrieve class definitions should be updated to utilize the new APIs for improved performance. The application developer should be aware that not all occurrences of !DescribeSchema can be replaced, such as when a complete schema is required for a particular operation. Also, providers that do not support the new commands can fall back on using !DescribeSchema and walk through the results to retrieve the schema, class names, and class definitions. 199 214 200 The existing !DescribeSchema API, which retrieves the full schema for all the available feature classes, will continue to perform as before. Performance gains will only be realized when the new APIs are used to restrict the response to the data of interest .215 The existing !DescribeSchema API, which retrieves the full schema for all the available feature classes, will continue to perform as before. Performance gains will only be realized when the new APIs are used to restrict the response to the data of interest when executed against supported providers. 201 216 202 217 == Test Plan ==