I was going through this article http://www.vaannila.com/spring/spring-ioc-1.html and here the term container is used. The diagram below shows container. What is contai
Let me explain what the spring container is ..suppose you have a java application with one class named Student and with one variable student name. here we go
public class Student{
private String name;
public void setName(String name){
this.name = name;
public void getName(){
System.out.println("Your Name : " + name);}}
Now you want the name variable should get automatically initialized to iqbal when application runs and the student object should be available inside the main class.
Now inside the main class we have ApplicationContext
public class MainApp {
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml");
Studentobj = (Student) context.getBean("student");
obj.getMessage();
}
}
SO please note here ApplicationContext ,this will act as a container and will create and manage the Student class for your application.