|
|||||||||||
|
Re: Connection::connect() interface is changing
From: Axel Howind <Axel.Howind(at)htp-tel.de>
Date: Mon Jul 16 2007 - 06:35:20 EDT
> I've given up on the reordering change that can cause silent breakage. No problem with that, but if you break it, make it obvious. >> Personally, I even think it is no good to have default parameters for >> setting up connections at all: this is something where I always want >> the developper to better think twice than just proceed using the >> default values. > > I can understand that to a point. But surely you can't be in favor of > candy machine interfaces? This one interface allows you to specify four > completely different underlying implementations. Taking your thought to > its extreme, you need to explicitly deal with three wrong choices in > order to select the one you do want. That's a mess. Why not have different interfaces for the different implementations? Make the default (and possibly copy-) constructor private and have factory methods as public interface, like: static Connection Connection::connectTCP ( host, user, port, ... ); static Connection Connection::connectNamedPipe ( ... ); static Connection Connection::connectDomainSocket ( ... );
Then use like this:
Or create a new connection factory class for this. Axel -- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsub=lists@pantek.comReceived on Mon Jul 16 06:35:31 2007 This archive was generated by hypermail 2.1.8 : Thu Aug 09 2007 - 19:28:29 EDT |
||||||||||
|
|||||||||||