public static function create(array $parameters, Configuration $configuration = null)
    {
        if (isset($parameters['driver_class'])) {
            if (!in_array('Fridge\DBAL\Driver\DriverInterface', class_implements($parameters['driver_class']))) {
                throw FactoryException::driverMustImplementDriverInterface($parameters['driver_class']);
            }

            $driverClass = $parameters['driver_class'];
        } elseif (isset($parameters['driver'])) {
            if (!isset(self::$mappedDriverClasses[$parameters['driver']])) {
                throw FactoryException::driverDoesNotExist($parameters['driver'], self::getAvailableDrivers());
            }

            $driverClass = self::$mappedDriverClasses[$parameters['driver']];
        } else {
            throw FactoryException::driverRequired(self::getAvailableDrivers());
        }

        if (isset($parameters['connection_class'])) {
            if (!in_array(
                'Fridge\DBAL\Connection\ConnectionInterface',
                class_implements($parameters['connection_class'])
            )) {
                throw FactoryException::connectionMustImplementConnectionInterface($parameters['connection_class']);
            }

            $connectionClass = $parameters['connection_class'];
        } else {
            $connectionClass = 'Fridge\DBAL\Connection\Connection';
        }

        return new $connectionClass($parameters, new $driverClass(), $configuration);
    }