I am currently experimenting with Google container inversion management. I used to have singlets for almost any service (database, active directory) used by my application. Now I have reorganized the code: all dependencies are set as parameters for the constructors. So far, so good. Now the hardest part is with the graphical user interface. I ran into this problem: I have a table (JTable) of products wrapped in a ProductFrame. I set dependencies as parameters (EditProductDialog).
@Inject
public ProductFrame(EditProductDialog editProductDialog) {
}
@Inject
public EditProductDialog(DBProductController productController, Product product) {
}
The problem is that guice cannot know which product I selected in the table, so it cannot know what needs to be entered in EditProductDialog.
( , , ), , EditProductDialog? DBProductController EditProductDialog, ProductFrame, , .
, - dependecy-?
, .
, , , ( ) .