public function setModule($namespace)
    {
        $nsParts = explode('\\', $namespace);
        $moduleClass = $nsParts[0] . '\Module';

        if (! class_exists($moduleClass, true)) {
            throw new InvalidArgumentException(sprintf(
                "The Module class was not found in the '%s' namespace.",
                $namespace
            ));
        }

        $module = new $moduleClass();

        /* Recommended.
         * If you Module class extends 'ZfcBase\Module\AbstractModule'.
         */
        if ($module instanceof AbstractModule) {
            $this->moduleDir = realpath($module->getDir());
            return $this;
        }

        /* Otherwise - get a path using of Reflection.
         */
        $reflection = new ReflectionClass($module);

        $this->moduleDir = realpath(dirname($reflection->getFileName()));
        return $this;
    }