Changes between Version 2 and Version 3 of FDORfc5


Ignore:
Timestamp:
07/16/07 14:26:37 (17 years ago)
Author:
thomasknoell
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc5

    v2 v3  
    99 
    1010||RFC Template Version||(1.0)||
    11 ||Submission Date||Jul 11, 2007||
    12 ||Last Modified||Barbara Zoladek [[Timestamp]]||
    13 ||Author||Barbara Zoladek||
     11||Submission Date||Jul 16, 2007||
     12||Last Modified||Thomas Knoell [[Timestamp]]||
     13||Author||Thomas Knoell||
    1414||RFC Status||draft||
    1515||Implementation Status ||under development||
    16 ||Proposed Milestone||3.3||
     16||Proposed Milestone||||
    1717||Assigned PSC guide(s)||Greg Boone||
    1818||'''Voting History'''||TBD||
     
    2424== Overview ==
    2525
    26 The purpose of this RFC is to add to {{{FdoClassDefinition}}} the methods for setting and getting a flag indicating if the class definition is based on a view.
     26The purpose of this RFC is to add a new property to the class ''FdoFunctionDefinition'' allowing the specification of the function class a given function belongs to. The valid function types will be defined in an enumeration and initially contain values to indicate aggregate, conversion, date, mathematical, numeric and string functions. The enumeration will also include a value to indicate an unknown function class. This function class will represent the default value.
    2727
    28 == Motivation ==
     28The following shows examples of functions listed with their corresponding function class:
    2929
    30 The top level requirements is to distinguish table and view based classes. However, there is no difference in functionality or behaviour between table and view based classes, for the schema designers it is important to know a type of the underlying datastore object.
     30AGGREGATE::
     31''Avg'', ''Max'', ''Min'', ''Sum''
     32
     33CONVERSION::
     34''ToDate'', ''ToDouble'', ''ToFloat'', ''ToInt32'', ''ToInt64''
     35
     36DATE::
     37''AddMonths'', ''CurrentDate'', ''ToString''
     38
     39MATH::
     40''Asin'', ''Atan'', ''Cos'', ''Exp'', ''Ln'', ''Log'', ''Sqrt''
     41
     42NUMERIC::
     43''Ceil'', ''Floor'', ''Round'', ''Sign''
     44
     45STRING::
     46''Concat'', ''Instr'', ''Lower'', ''Lpad'', ''Ltrim'', ''Upper''
     47
     48The function class will be set via the currently available interfaces (''create'' method). To allow this the interfaces will be enhanced with an optional function class parameter which will be set to the default value.
    3149
    3250== Proposed Solution ==
     51
     52The following shows the new enumeration.
     53
    3354{{{
    34 class FdoClassDefinition : public FdoSchemaElement
     55enum FdoFunctionClass {
     56                 FdoFunctionClass_Aggregate,
     57                 FdoFunctionClass_Conversion,
     58                 FdoFunctionClass_Date,
     59                 FdoFunctionClass_Math,
     60                 FdoFunctionClass_Numeric,
     61                 FdoFunctionClass_String,
     62                 FdoFunctionClass_Unknown
     63}  //  enum FdoFunctionClass
     64}}}
     65
     66The following shows the required changes to the class ''FdoFunctionDefinition''. Note that the listing only shows the modified or added specifications.
     67
     68{{{
     69
     70class FdoFunctionDefinition : public FdoIDisposable
    3571{
    3672...
    37 private:
     73protected:
     74    FdoFunctionDefinition (FdoString                       *name,
     75                           FdoString                       *description,
     76                           FdoDataType                     returnType,
     77                           FdoArgumentDefinitionCollection *arguments,
     78                           FdoFunctionClass                functionClass);
     79
     80    FdoFunctionDefinition (FdoString                       *name,
     81                           FdoString                       *description,
     82                           FdoPropertyType                 returnPropertyType,
     83                           FdoDataType                     returnType,
     84                           FdoArgumentDefinitionCollection *arguments,
     85                           FdoFunctionClass                functionClass);
     86
     87    FdoFunctionDefinition (FdoString                        *name,
     88                           FdoString                        *description,
     89                           bool                             isAggregate,
     90                           FdoSignatureDefinitionCollection *signatures,
     91                           FdoFunctionClass                 functionClass);
    3892...
    39    FdoBoolean   m_isViewBased;
    4093
    4194public:
     95...
    4296    /// \brief
    43     /// Gets the value of mIsViewBased. It is true if a class is based on view; otherwise is false.
     97    /// Returns the function class for the current function definition.
    4498    ///
    4599    /// \return
    46     /// Returns bool
     100    /// Returns FdoFunctionClass
    47101    ///
    48         FDO_API bool GetIsViewBased();
     102        FDO_API FdoFunctionClass GetFunctionClass();
    49103
    50     /// \brief
    51     /// Sets the value of mIsViewBased. It is true if a class is based on view; otherwise is false.
    52     ///
    53     /// \return
    54     /// Returns nothing
    55     ///
    56         FDO_API void SetIsViewBased( bool value );
     104    /// Various public Constructors
     105
     106        FDO_API static FdoFunctionDefinition *Create (FdoString                       *name,
     107                                                      FdoString                       *description,
     108                                                      FdoDataType                     returnType,
     109                                                      FdoArgumentDefinitionCollection *arguments,
     110                                                      FdoFunctionClass                functionClass = FdoFunctionClass_Unknown);
     111
     112        FDO_API static FdoFunctionDefinition *Create (FdoString                       *name,
     113                                                      FdoString                       *description,
     114                                                      FdoPropertyType                 returnPropertyType,
     115                                                      FdoDataType                     returnType,
     116                                                      FdoArgumentDefinitionCollection *arguments,
     117                                                      FdoFunctionClass                functionClass = FdoFunctionClass_Unknown);
     118
     119        FDO_API static FdoFunctionDefinition *Create (FdoString                        *name,
     120                                                      FdoString                        *description,
     121                                                      bool                             isAggregate,
     122                                                      FdoSignatureDefinitionCollection *signatures,
     123                                                      FdoFunctionClass                 functionClass = FdoFunctionClass_Unknown);
     124...
     125
     126protected:
     127...
     128    FdoFunctionClass m_functionClass;
     129...
     130
    57131}
    58132}}}
     
    61135== Implications ==
    62136
    63 This change will not cause any side-effects, nor will cause any compatibility problems.
     137This change will not cause any side-effects, nor any compatibility problems.
     138
    64139== Test Plan ==
    65140
    66 FDO test will be expanded for testing these methods.
     141Existing unit tests will be expanded to test those changes.
    67142
    68143== Funding/Resources ==