PropertiesFactoryBean

How to use PropertiesFactoryBean in your program ?

Questions by balamca416

Showing Answers 1 - 3 of 3 Answers

Amit Kumar Das

  • May 17th, 2015
 

Spring framework provides facility to inject bean using factory method. To do so, we can use two attributes of bean element.

1. factory-method: represents the factory method that will be invoked to inject the bean.

2. factory-bean: represents the reference of the bean by which factory method will be invoked. It is used if factory method is non-static.

There can be three types of factory method:

1) A static factory method that returns instance of its own class. It is used in singleton design pattern.
1.   
2) A static factory method that returns instance of another class. It is used instance is not known and decided at runtime.
1.   
3) A non-static factory method that returns instance of another class. It is used instance is not known and decided at runtime.
1.   
2.   

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions