4 ms·
Introducing the direct dependency is exactly what you want to avoid and what event buses provide. With your approach, you are coupling views and model with n*m
by hota_mazi 5y ago
Introducing the direct dependency is exactly what you want to avoid and what event buses provide.
With your approach, you are coupling views and model with n*m links, with an event bus, it's just n+m. Much easier to decouple your logic.
I do agree with you that I'm not a fan of the loss of static typing that event buses usually introduce.
- an_opabinia 5y ago> Introducing the direct dependency is exactly what you want to avoid Why? It's a GUI application on Android. Everything that listens to this event bus is a direct dependency configured at build time. Every modern optimization, like ahead of time compilation and code stripping, benefits from direct dependencies. This is why I used the word toxic, and not stupid.
- the_gipsy 5y agoCalling by strings is not decoupling. You just fooled the type system. Or yourself, if you want.