Hi while reading the book -Appress Spring Recipes- A problem solution Approach
i came across the ways of creating beans using static factory method....
I will give the source code below for easy understanding
The abstract class Product
The subclass Dvd
The subclass Battery
The factory method implementor class ProductCreator
the main class which creates the beans Main.java
My doubt is this guys if i comment the Application Context line still i get the correct output.
What is the use of the factory method and what happens when the ApplicationContext line is called?
What i mean is if i call ProductCreator.createProduct("aaa") i am going to get a bean so what is the use of the factory-method declared in the beans.xml file?
What does the factory-method in the beans.xml signify?
How does it affects my program?
Please help me here.........
Sorry if i have given the entire source code..