Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support annotating interfaces with their default implementation. #44

Closed
gissuebot opened this issue Jul 7, 2014 · 4 comments
Closed

Comments

@gissuebot
Copy link

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

@gissuebot
Copy link
Author

From kevinb9n on February 28, 2007 11:06:03

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?

@gissuebot
Copy link
Author

From crazyboblee on February 28, 2007 12:22:20

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.

@gissuebot
Copy link
Author

From crazyboblee on February 28, 2007 14:45:40

Let's go ahead and get this in so we can get some experience with it.

Labels: 1.0RC3

@gissuebot
Copy link
Author

From crazyboblee on March 01, 2007 13:50:07

Added in rev 251.

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant