I'm newbie to Spring and i'm trying to understand the BeanPostProcessor - postProcessBeforeInitialization and postProcessAfterInitialization.
Now when i run the DrawingApp, i got the following messages:
In postProcessBeforeInitialization bean = org.tutorial.spring.Point#5f0101fb
In postProcessAfterInitialization bean = org.tutorial.spring.Point#5f0101fb
In postProcessBeforeInitialization bean = triangle1
In postProcessAfterInitialization bean = triangle1
The `postProcessBeforeInitialization` as its word says should be before initialization but as you can see from the log, the setPointA is executed first and then the `postProcessBeforeInitialization` ..
So the BeanPostProcessor and InitializingBean is pretty much the same except that the former can be done for a large group of beans instead of per bean.
Also i noticed that BeanPostProcessor is done before the initializingBean if both of this exists.
But in theory they are the same.
am i right?
You showed up just in time for the waffles! And this tiny ad:
professionally read, modify and write PDF files from Java