public static function getServiceByName($serviceName) {
        $returnValue = null;

        
        $className = (!class_exists($serviceName) || !preg_match("/^(tao|wf)/", $serviceName)) ? sprintf(self::namePattern, ucfirst(strtolower($serviceName))) : $serviceName;

        // does the class exist
        if (!class_exists($className)) {
            throw new common_exception_Error('Tried to init abstract class ' . $className);
        }

        $class = new ReflectionClass($className);
        // is it concrete
        if ($class->isAbstract()) {
            throw new common_exception_Error('Tried to init abstract class ' . $className . ' for param \'' . $serviceName . '\'');
        }
        // does it extend Service
        if (!$class->isSubclassOf('tao_models_classes_Service')) {
            throw new common_exception_Error("$className must referr to a class extending the tao_models_classes_Service");
        }

        //create the instance only once
        if (!isset(self::$instances[$className])) {
            self::$instances[$className] = new $className();
        }

        //get the instance
        $returnValue = self::$instances[$className];
        

        return $returnValue;
    }