Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Invalid
-
5.0.5
-
None
-
None
Description
I have a utility I want to implement for our CMS which will create and bind default DAO service implements for various entity types. These services typically don't have their own interface and are referenced by the base interface and the service name. For instance, for a Widget entity it would look like this:
@Inject
private Dao<Widget> widgetService;
so when create the services you have to do something like this for all entities:
public static Dao<Widget> buildWidgetService()
{ ... }but I'd like to do something like this:
public static void bind(ServiceBinder binder) {
binder.bind(Dao.class, "widgetService", new DaoImpl(Widget.class));
}