public function getFactory($class, array $params = array())
	{
		if (!isset($this->factories[$class]) && $this->autowire) {
			$this->factories[$class] = Definition::getDefaultForClass($class);
		}

		$factory = $this->factories[$class];

		// if $params is defined, we need to either make a copy of the existing
		// Factory or make the Definition create a new factory with the params
		if ($params) {
			$factory = $factory->getFactory($params);
		}

		return $factory;
	}