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 8330127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:01:24+00:00 2026-06-09T02:01:24+00:00

I wonder how you can implement a simple login case with MVP. My MVP

  • 0

I wonder how you can implement a simple login case with MVP. My MVP framework does allow to fire events from the view only, I can’t fire events from the presenter. Don’t know if this is a good or a bad thing. I do see advantages with it but simple cases are just blown up with additional indirections.

So when I want to implement the simple login scenario I have the following.

  • LoginPresenter
  • LoginView
  • LoginModel

So what happens when the user fills in the login form and clicks on the login button?

  1. The view fires an event “login clicked”
  2. The presenter listens to that event and does the login using it’s model
  3. If the login was successufl, I have to call the view again to tell the login was successful.
  4. The view fires another event “login successful”.
  5. The presenter and other presenters now show another view and close the login window.

From my point of view the step via view for the successful event is just too much…

Is my framework wrong not letting me fire events from the presenter or is this a neccessary evil of MVP?

  • 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-06-09T02:01:25+00:00Added an answer on June 9, 2026 at 2:01 am

    Each framework will define its own rules regarding exactly how the View triggers the Presenter, or vice versa. You’ll have to dig around to see if any other frameworks seem slightly easier. However, the overall effort is likely to remain similar.

    It may seem like a lot of effort for a simple process like logging in, but in my opinion the pain is worth it for the benefits of unit-testability.

    Now you can test your log in process by mocking your View and your Model. Does the Presenter handle invalid inputs correctly? Does the View get the right prompting if the log in is incorrect/correct? All these questions can now be answered with unit tests using mocked objects for your Model and View.

    Just make sure your View(s) and Model(s) are defined as interfaces. Check out libraries such as JMock for helping with your unit testing.

    Then, imagine how useful this framework would be for a more complex scenario, like processing the customer’s order!

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

Sidebar

Related Questions

I wonder if we can implement and fetch data from different datasources into a
I wonder how can I search for a certain pattern in file, but only
I wonder whether someone can help me please. I'm trying to implement the mysql_insert_id()
I'm using the System.Net.HttpWebRequest class to implement a simple HTTP downloader that can be
I wonder how can I create a shadow similar to the one found in
I wonder how can I export a Visual Studio C++ project to Qt? I
Out of curiosity, I wonder what can people do with parsers, how they are
I'd like to start coding for NVIDIA 3D Vision and wonder where can I
wonder whether someone can help me with the following one... I have a struct
I wonder about that can I write native SQL to add or delete operations

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.