title: What is the real world use of BeanPostProcessor in spring?
body: <p>I am aware of the bean post processor and it's working but I am not sure how it will helps us in real world application. what should be there inside the below define method in real application could it be</p>
  <pre><code>1 Some configuration Code?
  2 Some validation code for bean ?
  
  
  
  
   public class MyBeanInitProcessor implements BeanPostProcessor{
       
          @Override
          public Object postProcessAfterInitialization(Object bean, String beanName)
                  throws BeansException {
              System.out.println(&quot;before initialization: &quot;+beanName);
              return bean;
          }
       
          @Override
          public Object postProcessBeforeInitialization(Object bean, String beanName)
                  throws BeansException {
              System.out.println(&quot;after initialization: &quot;+beanName);
              return bean;
          }
      }
  </code></pre>