You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@DefaultImplementation(ServiceImpl.class)
interface Service {
...
}
This can be used when a compile time dependency on the implementation is
acceptable, but you still want the flexibility of proxying, mocking, etc.,
that comes with interfaces.
I like the intent -- discoverable default implementations -- but I'm not sure I like
the means. Interface containing a hard reference to implementation just strikes me
as not very guicy. We discussed once the idea of a package annotation which you
would use on the package containing the interfaces, which would identify a class that
implements Module, and I kind of think it should identify it by a relative String
("impl/FooModule") even though I know that's crappy. Let's discuss further?
Yeah, I probably won't implement this right away, so there's plenty of time to
discuss. Like I said, I'm not exactly worried about the compile time dependency. This
feature is just for people who want the maximum brevity and only care about the
remaining benefits of using interfaces, particular to unit testing.
From crazyboblee on February 28, 2007 13:56:15
For example:
@
DefaultImplementation(ServiceImpl.class)interface Service {
...
}
This can be used when a compile time dependency on the implementation is
acceptable, but you still want the flexibility of proxying, mocking, etc.,
that comes with interfaces.
Original issue: http://code.google.com/p/google-guice/issues/detail?id=44
The text was updated successfully, but these errors were encountered: