On Jul 10, 2009, at 6:55 PM, Howard Lewis Ship wrote:
On Fri, Jul 10, 2009 at 3:27 PM, Norman Franke<nor...@myasd.com>
wrote:
First, I have a ton of DAOs that I need to bind the interface to the
implementation. I'd like to do this automatically, so I don't have
to keep
modifying my AppModule for each DAO I create. What's the best way
to go
about this? I figure if I can somehow get a ClassNameLocator
instance, I
could just iterate through my package and do it that way. However,
how do I
get a ClassNameLocator in bind(ServiceBinder)?
Look at the ServiceBinder interface; there are methods there
(especially in 5.1) that may address your needs.
ServiceBinder just has three bind() methods and nothing else
interesting. This one seemed promising:
<T> ServiceBindingOptions bind(Class<T> serviceInterface,
ServiceBuilder<T> builder);
However, I can't add stuff to the ServiceBinder from the
ServiceBuilder. And even with .eagerLoad(), buildServices() method
isn't called until after AppModule.bind() has finished. I can't see
how I can both add bindings while obtaining a ClassNameLocator.
Any other tips?
Norman Franke
Answering Service for Directors, Inc.
www.myasd.com