From: DataLayer D. L. <dat...@li...> - 2006-11-23 18:35:50
|
On 11/23/06, DataLayer Development List < dat...@li...> wrote: > > *DataServices*** > > > > DataSourceManager: > > > > - data_sources modified to use a generic dictionary with string keys and > DataSource values. > It is an important issue to keep backward compatibility in this stage of development, it's good to use generics and nullable types but i think right now it's much better to keep compatibility. > - LoadDataSources static function to read configuration file and > instanciate each DataSource and add it to data_sources. > I think all the configuration operations are better if they are handled by a separate component in this case the Configuration class. > - New Static constructor calling LoadDataSources() > DataSource: > > - New constructor to create a DataSource passing each connection > parameter using separate variables. > > - New instance fields to store each connection parameter > separately (username, password, host, port and database) > > - New abstract BuildConnectionString() to build a connection > string based on connection parameters stored in DataSource instance fields > (username, password, host, port and database) > > - New abstract DeconstructConnectionString() to extract connection > parameters from connection_string instance field and save them on separate > instance fields (username, password, host, port and database) > > - Call BuildConnectionString and DeconstructConnectionString on > respective constructors. > We chose to keep the connection string as a simpe string in the DataSource in order to be able to introduce new data providers without the need of create new classes and modify the BuildConnectionString() and DeconstructConnectionString() in each one. **************************************************** > - Connection instance and property removed. No connection > instance is mantained by DataSource. > > - GetType function removed to enforce DataSource abstraction and > avoid DataSource modification on future provider additions. > > - TODO: Remove ConnectionStringBuilder()static function. This > functionality is implemented by BuildConnectionString() > > - BeginTransaction() uses new connections for new transactions. > > - CreateCommand functions removed. There is no need of Command > object. That functionality is delegated to Query object on DataLayer to > keep DataSources a low-level layer. Only IDbCommands are used by this > layer. > > - FillSchema() function now receives a DbDataAdapter instead of a > Command containing that DbDataAdapter. Locks implemented to avoid > concurrent DataTable modification on mult-threaded environments. A new > FillSchema() overload to accept a select IDbCommand from which a > DbDataAdapter will be created. > > - Fill() overloaded and changed with similar behavior to > FillSchema(). > > - Update() similar changes to Fill and FillSchema with additional > overload to accept an array of DataRow's > > - New ComparisonOperators and LogicalOperators enumerations. > > - New ParseComparisonOperator and ParseLogicalOperator virtual > functions to parse those enum values to sql equivalent operators. > > - New ParseRowFilterValue function to parse a parameter value into > a valid string to be used as filter on a DataView > > - CreateCommandBuilder function removed. Command building process > is delegated to each provider DataSource implementation. > > - Open and Close functions removed. No connection is maintained on > DataSource > > - New ConstructParameter() and DeconstructParameter() to let each > DataSource implementation create the string parameter to be used with an > IDbCommand. (Different characters are used to parse parameters. SQL: '@', > MySQL: '?', PGSql: ':') > > - New LiteralDate() and LiteralString() abstract functions to let > each DataSource provider specify literals for strings and dates. > > - New ColumnInfo struct to store metadata information related to a > field. > > - New abstract function GetTableColumns to retrieve metadata > information related to a table. > > - New abstract function ParseType to map equivalent specific > provider data types with standardized DbType enumeration. > > - Each DataSource implementation was updated with new changes. > > - Added one resources file for each DataSource to store commands > to retrieve metadata information and keep clean code. > **************************************************** I think all these changes enclosed in asterisks above can be applied without change much of the code made by us. We can make a manual merge. *DataLayer*** > > > > - New DataBaseManager class to create DataBase's based on > DataSource's maintained by DataSourceManager from DataServices layer. Each > DataBase is stored on a dictionary with the same string key of the > DataSource and a DataBase value. > > - New Table and Query Objects wich uses DataSource's services. > > - New IQueryComponent > > - New TableJoin, TableJoinCollection, WhereStatement and > WhereStatementCollection classes used by Query class. All classes > implement IQueryComponent interface. > > > > DataBase: > > - New Constructor to receive a DataSource to be used by DataBase. > > - New data_source field and DataSource property to store and > expose the DataBase's DataSource. > > - All static functions are now instance functions. > > - New table_pool generic dictionary to keep a collection of Table > objects mapped to DataTables stored on instantiated DataSet. > > - DataSet is now maintained as an instance field. Property also > changed to instance scope. > > - New DataSource instance field to bind DataBase with related > DataSource. All DataBase's operations are done trough this field. > > - Fill now accepts only a Query object which is used to execute > and fill DataTable stored on DataBase. > > - Update now only accepts a table name to be updated and uses > Table and Query services. > > - New GetTable function to retrieve a Table stored on table_poolif it has been created previously or creates a new one, stores it on the > pool and returns it. > > > > TableAttribute > > - New DataSource property to specify the key name of table's > DataSource. > > - New constructor to specify table name and DataSource's key. > > - New data_source field to store table's DataSource key. If it's > not specified, Table is mapped to first configured DataSource. > Manuel you have to tell us if these changes in the DataLayer project are affected if we keep our code in DataServices and introduce only the changes I enclosed in asterisks above. ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > Datalayer-Devel mailing list > Dat...@li... > https://lists.sourceforge.net/lists/listinfo/datalayer-devel > > > |