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

MyModule.configure() should be public in the User's Guide #57

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

MyModule.configure() should be public in the User's Guide #57

gissuebot opened this issue Jul 7, 2014 · 6 comments

Comments

@gissuebot
Copy link

From burke.eric on March 09, 2007 11:53:16

The MyModule example in the User's Guide, under the Startup heading,
contains this code:

public class MyModule implements Module {
  protected void configure(Binder binder) {
    ...
  }
}

The configure() method should be public, since it implements an interface
and won't compile as written.

Original issue: http://code.google.com/p/google-guice/issues/detail?id=57

@gissuebot
Copy link
Author

From hani@formicary.net on March 09, 2007 09:10:07

I'd say that it's even better to cut out that example or just mention 'implements Module' in passing, since most of
the time it's AbstractModule that people will care about, certainly when starting.

@gissuebot
Copy link
Author

From crazyboblee on March 09, 2007 09:22:03

The original example uses AbstractModule (hence protected) but I was afraid of
introducing too many concepts in the introduction. Think I should go ahead and just
us AM?

@gissuebot
Copy link
Author

From hani@formicary.net on March 09, 2007 09:25:51

My vote is to use AM and just show the configure() method with the bind calls. I thinkt hat Binder is an
implementation detail, rather than a crucial concept for users, at this point. The first intro should be all about
Module -> Guice -> Injector.

@gissuebot
Copy link
Author

From kevinb9n on March 15, 2007 11:11:01

I think I fixed this.  The examples use Module, not AbstractModule now.  I believe
this is right because

(a) I believe that just seeing bind() instead of binder.bind() produces a bit of a
"huh?" reaction.  bind() seems a little more mysterious as something you just inherit
and call up to.  binder.bind() shows you exactly, here's a Guice object that you
telling your information to.

(b) Some people are quite put off if they believe they're going to be forced to
extend a particular class to use a framework, and will likely react to seeing that
'extends' front and center.  Seeing that Module is an interface tells them that we
aren't going to hamper and restrict them in that way.

@gissuebot
Copy link
Author

From kevinb9n on March 15, 2007 11:11:30

(No comment was entered for this change.)

Status: Fixed

@gissuebot
Copy link
Author

From crazyboblee on March 15, 2007 14:05:07

Sounds good to me.

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