dbTalk Databases Forums  

Re: v2.0 release plan

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Re: v2.0 release plan in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Warren Young
 
Posts: n/a

Default Re: v2.0 release plan - 06-14-2005 , 01:42 PM






Chris Frey wrote:

Quote:
Connection<MysqlDriver> con;
Connection<PostgreSQLDriver> con2;
I'm not sure templatizing Connection is required. You could just add a
parameter to the ctor:

Connection con(new MySQLDriver, ...)

The semantic difference is that Connection has-a driver, it is not
implemented-in-terms-of-a specific driver type. (Connection clearly
could be implemented in terms of a generic driver type, which implies
inheritance, not templates.)

One benefit of my way is that you don't duplicate the code of Connection
in the binary for each concurrent driver type you use.

Another benefit is that a program could switch database types without
being rebuilt. It could have a preference file of some sort, saying
which database server is on this particular system. The program would
just pass a different DatabaseDriver subclass instance when creating the
Connection object.

The only advantage to the template method is that you wouldn't have a
pointer indirection when calling the driver. But since almost every
driver call involves a database server interaction, optimizing call
times pointless.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.