I stumbled upon Otto, and it looks like it's used as a replacement for Broadcast events. I read the doc but, I don't understand if there are much advantages to use Otto.
Benefits of event-driven architecture. Event-driven architecture can help solve the problems of the close coordination of microservices, error handling and retries, and coordination between development teams.
Should you use an event-driven architecture? Event-driven architectures are ideal for improving agility and moving quickly. They're commonly found in modern applications that use microservices, or any application that has decoupled components.
EventBus is an open-source library for Android and Java using the publisher/subscriber pattern for loose coupling. EventBus enables central communication to decoupled classes with just a few lines of code – simplifying the code, removing dependencies, and speeding up app development.
Otto should rather be compared to LocalBroadcastManager. This is because the both Otto and LocalBroadcastManager do not support inter-process communication.
Otto's pros:
@Producer
s.Otto's cons:
It may not matter depending on the structure of your app, but Otto also doesn't require having a Context
handy to send events or register listeners.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With