Warren Young schrieb:
> I've given up on the reordering change that can cause silent breakage.
> But you must accept that I do intend to break things. If I am not
> allowed to break anything, there's no point to v3.
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:
Connection con = Connection::connectTCP(...);
Or create a new connection factory class for this.