ghedeon02/01/2019, 12:54 AM
gradle module depends on
library module). The general advice that I often see: if you don't want to get lost in dagger — don't bring Components to the library modules. It's easier if you just connect all your dagger modules from libraries in the final
module under one Component. That works, up to a point. Let say you need to do some manual injection in one of the libraries. But Component is in the
, so you don't have a direct reference. What are my options here?
dkhusainov02/01/2019, 5:00 AM
ghedeon02/01/2019, 7:37 PM
Joe02/01/2019, 7:44 PM
ghedeon02/01/2019, 7:55 PM
is it possible for the feature component to include some modulesnot in this setup. It's just an interface in the feature, not a real component, so you can't attach modules to it. Ex: 1.
is defined in
library. Plus, some kind of a singleton, where you set you component later. 2. In the app,
is a real dagger component, that extends
interface and uses
3. Once you have
instance, set it to your singleton, that you defined in the feature. Now it can be used in the feature library.
Joe02/01/2019, 7:58 PM
ghedeon02/01/2019, 7:59 PM
David02/01/2019, 8:29 PM
Joe02/01/2019, 8:37 PM
David02/01/2019, 8:43 PM
This ideal prohibits app-> module tangle like that.I lied. I always have a module API that needs a
. But genuinely, that’s it
Joe02/01/2019, 8:57 PM
ghedeon02/01/2019, 8:58 PM
meaning that core dependencies are shared by the feature modules.
app / \ feature1 feature2 \ / core
David02/01/2019, 9:07 PM
becoming a dumping ground. So long as it is lean (XML, Styles, annotations etc.) I think you’re good. Unless the diamond shape is some antipattern I’m unaware of!
module is a bit of an antipattern as is
. The models and DAOs to which they map are migrating to feature modules as I complete my IA and move onto Dynamic Feature Modules
ghedeon02/01/2019, 9:12 PM
is not that light as you described it. Many times features are using similar entities and rest services, so core layer can get pretty advanced, most probably even splitted into
David02/01/2019, 9:14 PM
) and have this “blob” module called
for their DataAdapters and being done with it.
ghedeon02/01/2019, 9:29 PM