public function getServiceInstance($key, $useCache = true)
    {
        // retrieve the service from the instance cache if it exists
        if ($useCache && isset($this->instanceCache[$key])) {
            return $this->instanceCache[$key];
        }

        // retrieve the given controller from the key using the proper
        // provisioning mode
        switch ($this->provisioningMode) {
            case self::PROVISIONING_MODE_NAMESPACES:
                $this->instanceCache[$key] = $this->getServiceFromNamespaces($key);
                break;
            case self::PROVISIONING_MODE_FOLDERS:
                $this->instanceCache[$key] = $this->getServiceFromFolder($key);
                break;
            default:
                $this->instanceCache[$key] = $this->getServiceFromServiceList($key);
        }
        return $this->instanceCache[$key];
    }