Iky Container is an IoC 'proof of concept' framework, still at an early stage, but mature enough to provide those features :

  • Constructor type IoC dependency injection.
  • Container configuration through XML file.
  • RMI-Enabled components.

Default container usage

		// Instanciate a container named "myContainer"
		ContainerI container = new DefaultContainer("myContainer");
		// Register a component under it's fully qualified class name
		// Register component under an alias
		container.registerComponentImplementation(MyClass.class, "myClass");
		// Register an instance
		Object obj = new Object();
		// Retrieve objects
		MyClass = (MyClass) container.retrieveComponentInstance(MyClass.class)

XML container usage

An XML definition file for a container looks like this :

		<!-- Containers Definition -->
				    <name>Internal Services</name>
			<!-- Component Definition -->
					<name>Internationalization Service</name>
					<name>Local Console Service</name>

It defines a container named "Internal Services" that registers two components, "Internationalization Service" and "Local Console Service". The container is created this way :

			ComponentFactoryI factory = new XmlContainerFactory("someXmlFile.xml");
			ContainerI container = (ContainerI) factory.retrieveInstance();

See the javadoc for the whole possibilities.