public function set($id, $definition, $args = null, $factory = false) {
		if (isset($this->_definitions[$id])) {
			throw new Exceptions\ServiceOverride('Service "' . $id . '" already exists');
		}
		
		$definition = $this->normalizeDefinition($definition);
		
		if ($args !== null) {
			$args = $this->processArguments($args);
			$definition->setArguments($args);
		}
		
		if ($factory) {
			$definition->setFactoryMode();
		}
		
		$this->_definitions[$id] = $definition;
		
		return $definition;
	}