In my Spring Boot web application there are two beans, one of them inherits other one and both implements an interface. Something line this:
@Component
public class A implements SomeInterface {
// ....
}
@Component
public class B extends A implements SomeInterface {
// ....
}
Is it a good idea to make one bean extending another one or it's better use a decorator? And why?
I don't mean any specific case but general one.
Aucun commentaire:
Enregistrer un commentaire