Spring Boot - specify concrete class in configuration properties.
posted 4 months ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Say I have a class
and I want to configure it with a bunch of concrete classes that implement ItemInterface...
Is it possible to specify the class of each item in application.yaml?
Something like
I should say, this is not something I can handle with profiles.
Ultimately this list will contain a different set of concrete classes per product deployment, so I would want to externalise it.
and I want to configure it with a bunch of concrete classes that implement ItemInterface...
Is it possible to specify the class of each item in application.yaml?
Something like
I should say, this is not something I can handle with profiles.
Ultimately this list will contain a different set of concrete classes per product deployment, so I would want to externalise it.
posted 4 months ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Did you resolve it with this?
https://coderanch.com/t/790679/frameworks/Spring-boot-externalise-bean-configuration
https://coderanch.com/t/790679/frameworks/Spring-boot-externalise-bean-configuration
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
posted 4 months ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Kinda sounds like you're trying to solve a programming problem with a build management tool.
Alternatively could you inject the right kind of "items" into your class based on some kind of configuration like an environment variable?
Alternatively could you inject the right kind of "items" into your class based on some kind of configuration like an environment variable?
Tim Driven Development | Test until the fear goes away
John Farrel
Ranch Hand
Posts: 125
posted 4 months ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I did it by loading the config via ImportResource, using an xml bean definition (which lets you choose the concrete classes)
| Evacuate the building! Here, take this tiny ad with you: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |









