I\'m new to dagger (though I have experience with DI from working on Java EE WebApps using Weld).
What I\'m trying to do is to inject a dependency into a class. The
Making a private field 'package visible' may not always be what you want. The Dagger documentation suggests the following:
Injecting final fields and private members. For best performance Dagger generates code. Work around this by using constructor injection.
Here's an example:
private ItemFactoryImpl itemFactory;
private BuildingFactory buildingFactory;
@Inject
public World(ItemFactoryImpl itemFactory, BuildingFactory buildingFactory) {
this.itemFactory = itemFactory;
this.buildingFactory = buildingFactory;
}