Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subbed EventBus for Otto in third-party libs doc #48

Merged
merged 1 commit into from
Dec 2, 2016

Conversation

weathersboyle
Copy link
Contributor

No description provided.


An event bus tailored to Android, Otto supports communication between distinct application components, when the use of a traditional interface is inadequate or cumbersome.
An event bus tailored to Android, greenrobot's EventBus supports communication between distinct application components; generally, the event bus should only be used when a traditional interface is inadequate or cumbersome, or an event is broadcast to multiple listeners at once.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should removegenerally, the event bus should only be used when a traditional interface is inadequate or cumbersome, event bus shouldn't be used simply as way of avoiding passing callbacks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, I know that's your position, and I generally agree with you; I don't oppose removing it. Are there any cases where you want strong decoupling, for which you'd entertain the idea of using the bus? The service-activity/fragment example is popular, but you can certainly connect to the service and treat it like an interface, though that connection step is async

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would then be a matter of how many activities can be bound to a service. If multiple activities are listening for the service and/or the service is not bound to any particular activity, the event bus would be appropriate. However, if the service should only be active when a certain activity is active, then a connection interface would be better.

@brightredchilli
Copy link
Contributor

brightredchilli commented Nov 27, 2016

Hi @weathersboyle, @f2rf2r, just restarting this convo here - is there a common denominator of an edit from this conversation? It seems like the change from Otto to EventBus is certainly helpful. While I do think that the 'generally' statement is a bit redundant, I don't think it's so bad. After all, when an interface is inadequate or cumbersome is totally up to the developer. There is no bad recommendation here per se.

@weathersboyle weathersboyle merged commit 471a37f into master Dec 2, 2016
@ButkiewiczP ButkiewiczP deleted the rob/third-party-libs branch June 6, 2017 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants