package my.kayden.autoWiring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import my.kayden.autoWiring.company.Department;
import my.kayden.autoWiring.company.Employee;

public class App 
{
	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");  // A bean will be created by this line.
		Employee e1 = (Employee) context.getBean("employee");
		System.out.println(e1.toString());
		Department d1 = (Department) context.getBean("department");
		System.out.println(d1.toString());
		((AbstractApplicationContext) context).close();
	}
}
