mercredi 11 janvier 2023

Service Locator vs Strategy Pattern in Spring

Service Locator is considered as an anti-pattern but while implementing strategy pattern in Spring, we use a Hashtable that contains all the different implementations of the beans and we get them by using the bean name as the key.

Does using strategy pattern is also an anti-pattern in the context of Spring and dependency injection?

Aucun commentaire:

Enregistrer un commentaire