Changes between Version 33 and Version 34 of FDORfc34


Ignore:
Timestamp:
08/26/09 19:02:28 (15 years ago)
Author:
klain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc34

    v33 v34  
    601601A high level class diagram of existing reader related interfaces in FDO is as illustrated below.
    602602 
    603 Both FdoISqlReader and FdoIDataReader have the function to get the column name or property name according to the index. With this capability, it should be pretty easy to provide default implementation for all indexed access functions. Take FdoIDataReader as an example:
     603Both FdoISqlReader and FdoIDataReader have the function to get the column name or property name according to the index. With this capability, it should be pretty easy to provide default implementation for all access by index functions. Take FdoIDataReader as an example:
    604604
    605605class FdoIDataReader: public FdoIReader
    606606{
    607607public:
    608     virtual FdoInt32 GetInt32(FdoInt32 index);
     608    virtual FdoInt32 GetInt32(FdoInt32 index)
     609    {
     610        FdoStringP propName = GetPropertyName(index);
     611        return GetInt32(propName);
     612    }
    609613}
    610 
    611 An implementation file (IDataReader.cpp) needs to be added:
    612 
    613 FdoInt32 FdoIDataReader::GetInt32(FdoInt32 index)
    614 {
    615     FdoStringP propName = GetPropertyName(index);
    616     return GetInt32(propName);
    617 }
    618 
    619 Note here, FdoIDataReader is overriding the GetInt32(FdoInt32 index) derived from FdoIReader. So providers can inherit the default implementation automatically without changing any codes. It only needs a recompile. Off course, providers can choose to override the default implementation by theirs if they like.
    620614
    621615In order to make it work in all cases, FdoIFeatureReader also needs to expose a function of FdoString* GetPropertyName(FdoInt32 index) and each provider needs to override it. It has been illustrated in above updated FdoIFeatureReader interface. This work is avoidless that each provider has to know how to map between property name and index for the default implementation.
     
    655649All pure virtual functions for access by index are overrided with the default implementation in a similar way. e.g.
    656650{{{
    657 FdoBoolean FdoIFeatureReaderByIndex ::IsNull(FdoInt32 index)
     651FdoBoolean FdoIFeatureReaderByIndex::IsNull(FdoInt32 index)
    658652{
    659653    FdoStringP propName = GetPropertyName(index);
     
    669663}
    670664}}}
    671 It is expected that resourcing will be supplied to modify all the existing FDO Open Source providers. Unless there are noticeable performance complaints, all of the open source providers will use the default implementation for this release.
     665It is expected that resourcing will be supplied to modify all the existing FDO Open Source providers. Unless there are noticeable performance complaints, all of the open source providers will use the default implementation for this time.
    672666
    673667== Test Plan ==