How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

How to dynamically select a TreeRepository bean at runtime in Spring Boot without a massive switch?

calendar_today May 27, 2026 person JORGE MARIO CANO COBON domain spring-boot

I am building a Java Spring Boot application that manages a binary tree structure. Currently, data storage (MongoDB, PostgreSQL, and Memory) and the tree structure (Custom and Collections) are handled differently. For testing, I am changing the strategy by directly editing the pom.xml , but I need a method to handle this dynamically from the UI while the system is running.

open_in_new Read original post