I am new to Spring Boot. I am writing a sample project to learn. I have a superclass service. I have two subclass services which extend superclass service. In RestController I want to dynamically use one of the subclass based on a if condition. Is it a good idea? Any better way to do that? I know that if else condition to use a concrete class is bad.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
Found a good solution here w3spot.com/2022/04/how-to-dynamica.... Posting it for others. I liked the approach.