Creating Spring Bean dynamically in the Runtime

After 5 years it seems that this article in my blog is the most popular one, over 9,300 page views. So, it’s time to update this article. I also added a Github example for this article.

The Example springbean-dynamic at Github

In my training someone asked me whether it is possible to create an object (a Spring Bean) dynamically so you can choose which implementation you want to have in the runtime. So at the compile time