List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:July 14 2007 4:20am
Subject:Re: Connection::connect() interface is changing
View as plain text  
Joel Fielder wrote:
> Connection
> connection(ConnectionLoginDetails().Database("whatever").Server("localho
> st").Password("noh4xzorssszz"));

My purpose in doing this isn't because I believe the new parameter order 
is the One True Way, it's because I want to reduce typing by eliminating 
the need to pass all the parameters.  Adding verbosity is exactly the 
wrong thing.

I could be talked into something less verbose, but in the same vein, 
like this:

	class Connection ... {
	public:
		class TCP {
		public:
			TCP(host, user, port, etc...);
		}
		Connection(const TCP& tcp);

	#ifdef MYSQLPP_PLATFORM_WINDOWS
		class NamedPipes {
		public:
			NamedPipes();
		}
		Connection(const NamedPipes& np);
	#else
		class DomainSockets {
		public:
			DomainSockets(path);
		}
		Connection(const DomainSockets& ds);
	#endif
	}

Usage:

	Connection con(Connection::TCP(host, user, port));				Connection 
con(Connection::NamedPipes());
Thread
Connection::connect() interface is changingWarren Young13 Jul
  • Re: Connection::connect() interface is changingDrew M.13 Jul
    • Re: Connection::connect() interface is changingWarren Young13 Jul
  • RE: Connection::connect() interface is changingYuantu.Huang13 Jul
    • Re: Connection::connect() interface is changingWarren Young13 Jul
      • RE: Connection::connect() interface is changingJoel Fielder13 Jul
        • RE: Connection::connect() interface is changingWilliam F. Dowling13 Jul
        • Re: Connection::connect() interface is changingWarren Young14 Jul
          • Re: Connection::connect() interface is changingWarren Young14 Jul
            • Re: Connection::connect() interface is changingAlex Burton15 Jul
              • Re: Connection::connect() interface is changingPeter Garner15 Jul
              • Re: Connection::connect() interface is changingWarren Young16 Jul
          • RE: Connection::connect() interface is changingJoel Fielder16 Jul
            • Re: Connection::connect() interface is changingWarren Young16 Jul
              • Re: Connection::connect() interface is changingAxel Howind16 Jul
                • Re: Connection::connect() interface is changingWarren Young16 Jul
  • Re: Connection::connect() interface is changingAxel Howind13 Jul
    • Re: Connection::connect() interface is changingWarren Young14 Jul
      • Re: Connection::connect() interface is changingAxel Howind16 Jul
  • Re: Connection::connect() interface is changingAlex Burton13 Jul
    • Re: Connection::connect() interface is changingWarren Young14 Jul
  • RE: Connection::connect() interface is changingJim Wallace13 Jul
    • Re: Connection::connect() interface is changingWarren Young14 Jul