Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7032593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:57:19+00:00 2026-05-28T00:57:19+00:00

I am using an MVP architecture (or at least an approximation of one) and

  • 0

I am using an MVP architecture (or at least an approximation of one) and have a hierarchy of presenters, with similarly nested views. I’ll stick to the first 2 levels for simplicity:

AppPresenter/AppView at the top level. DocumentListPresenter/DocumentListView and TranslationPresenter/TranslationView at the second level.

The two second level views are added to a panel on the top level view as widgets, but at the moment this is done by injecting the two second level presenters into the top level presenter, then having the top level presenter pass their views to its view through setter methods.

This seems a bit of a roundabout way of doing things. Is it possible with Gin to inject the second level views into the top level view without the presenters being involved at all?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:57:20+00:00Added an answer on May 28, 2026 at 12:57 am

    I have managed to get this working with a minor change to the guice code (overridden in my local class that extends AbstractPresenterModule:

    @Override
    protected <D extends Display> void bindDisplay(Class<D> display, Class<? extends D> displayImpl)
    {
       bind(display).to(displayImpl).in(Singleton.class);
    }
    

    The bindPresenter() method I’ve been using binds the presenter as a singleton, and calls bindDisplay() to bind the display interface to its implementation, but the latter is not a singleton binding so I was ending up with different instances (one linked to the presenter, the other linked to the containing display class).

    Overriding the bindDisplay() method to make the display binding a singleton ensures that the display implementation injected into another display is the same instance to which the presenter is bound.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So i am writing my first Java application using MVP pattern. One of MVPs
I am using the MVP design pattern and I have registered my presenter as
I have been playing around with the MVP pattern using winforms for the last
I have some doubts, i m developing a web application in GWT using MVP
I am using GWT MVP II (with the UiBinder) and I have a question.
Currently we are using GWT Platform with MVP architecture for our UI development. I
I followed https://developers.google.com/web-toolkit/articles/mvp-architecture . In their model, they use one class 'Contact' and a
I am trying to implement the MVP method for the first time, using WinForms.
How does one handle a user confirmation when using MVP/MVC in a Web environment?
Using a MVP Pattern in a WinForms app I have been asked to write.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.