Defines a connection factory.