# Dynamic beans in spring

DevFeed: [Dynamic beans in spring](<https://devfeed.tech/articles/dynamic-beans-in-spring-27271.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201705/dynamic-beans/>)

Published: 2017-05-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [properties](<https://devfeed.tech/topics/properties.md>), [import](<https://devfeed.tech/topics/import.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [create](<https://devfeed.tech/tags/create.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [implement](<https://devfeed.tech/tags/implement.md>), [properties](<https://devfeed.tech/tags/properties.md>), [property](<https://devfeed.tech/tags/property.md>), [spring](<https://devfeed.tech/tags/spring.md>)

## AI overview

A tutorial on programmatically creating Spring beans with BeanFactoryPostProcessor and BeanDefinitionRegistry. It covers defining individual and multiple beans, using constructor or factory-method initialization, and generating bean definitions from property-based options.

## Source excerpt

Some time ago I've been trying to dynamically create spring beans. After fast stackoverflow check I decided to drop it and go with something else. Lately I've been trying to implement more complicated bean registration mechanism in which skipping dynamic bean creation wasn't an option. Here's how you can create spring beans "from code". Read more