Hi every one, i am totally new to Guice - In DI frameworks in general
- . Now i am facing a dilemma witch is how to bind and create with
guice object that has dependency injection ? and here is what i mean

@Inject
public class A {
    private B b ;

    public A(B b){
       this.b=b;
   }
}

public class B {

 private   A a ;

@Inject
  public B(A a){
   this.a = a;
}


and here is a real situation of my problem, actually it is the MVP GWT
pattern design using UiBinding.

public class LoginPresenterImpl implements LoginPresenter {

  private HasHandlers eventBus;
  private LoginFormErrorMessages errorMessages;
  private UserAccountServiceAsync async;
  private LoginView loginDisplay;

  @Inject
  public LoginPresenterImpl(UserAccountServiceAsync serviceAsync,
LoginView loginview, HasHandlers handlerManager,
LoginFormErrorMessages loginFormErrorMessages) {
    async = serviceAsync;
    loginDisplay = loginview;
    eventBus = handlerManager;
    errorMessages = loginFormErrorMessages;
  }

......

}

and the LoginView is :

public class LoginViewImpl extends Composite implements LoginView {


  @UiTemplate("LoginView.ui.xml")
  interface LoginViewUiBinder extends UiBinder<DecoratorPanel,
LoginViewImpl> {
  }

  @UiField
  TextBox username;
  @UiField
  PasswordTextBox password;
  @UiField
  Button login;
  @UiField
  Button newRegistration;
  @UiField
  Label warningLabel;


  private LoginViewUiBinder binder =
GWT.create(LoginViewUiBinder.class);

  @Inject
  private LoginPresenter loginPresenter;


  public LoginViewImpl() {
    initWidget(binder.createAndBindUi(this));
  }
......

}

how to binde the view ??? and the Presenter ?


-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to