function getServiceManager()
    {
        if (!$this->sm || !$this->sm instanceof ServiceLocatorInterface)
            $this->sm = new ServiceManager
            (
                new ConfigureService($this->def_sm_config)
            );

        if (!$this->sm->has('ServiceManager'))
            $this->sm->setService('ServiceManager', $this->sm);

        if (!$this->sm->has('Application'))
            $this->sm->setService('Application', self::$instance);

        if (!$this->sm->has('Application.Config')) {
            $this->sm->setService('Application.Config', $this->config()->borrow());
            $this->sm->setAlias('ApplicationConfig', 'Application.Config');
        }

        return $this->sm;
    }