mercredi 24 février 2021

Is event bus an acceptable use of singleton?

Assuming an event bus used to control all events subscription/publishing in the code, is it a suitable target for the singleton pattern?

It seems to me it attends to all requisites to make it singleton and not run into the design problems that singleton usually ends up into.

What do you think? Is singleton an anti-pattern even in cases like this?

Aucun commentaire:

Enregistrer un commentaire