android10 / Android-CleanArchitecture

This is a sample app that is part of a series of blog posts I have written about how to architect an android application using Uncle Bob's clean architecture approach.
Apache License 2.0
15.49k stars 3.33k forks source link

Convention Violation #75

Closed garik-sargis closed 8 years ago

garik-sargis commented 8 years ago

The ActivityModule.activity() method doesn't conform to the provider-method naming convention. Is this on purpose? Isn't provideActivity() a better name?

android10 commented 8 years ago

Here is the article where I explain it: http://fernandocejas.com/2015/04/11/tasting-dagger-2-on-android/

activity() in ActivityComponent is for exposing activities to sub graphs:

@PerActivity
@Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class)
public interface ActivityComponent {
  //Exposed to sub-graphs.
  Activity activity();
}
yshrsmz commented 8 years ago

I think he is talking about this line.

https://github.com/android10/Android-CleanArchitecture/blob/master/presentation/src/main/java/com/fernandocejas/android10/sample/presentation/internal/di/modules/ActivityModule.java#L37

android10 commented 8 years ago

@yshrsmz even though that, I'm not providing any activity as far as I remember, when I need a context, there is a provider for it.