public static function factory($name)
    {
        $classname = get_called_class();

        if (!isset(self::$instances[$classname])) {
            self::$instances[$classname] = array();
        }

        if ($name instanceof Value) {
            $name = $name->getValue();
        }

        if (!isset(self::$instances[$classname][$name])) {
            $instance = new static($name);
            $name = $instance->getName();

            if (!isset(self::$instances[$classname][$name])) {
                self::$instances[$classname][$name] = $instance;
            }
        }

        return self::$instances[$classname][$name];
    }