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

  • Home
  • SEARCH
  • 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 7521141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:11:08+00:00 2026-05-30T02:11:08+00:00

What is a good method for loosely-coupled inter-controller communication in MVC/MVP? For example, in

  • 0

What is a good method for loosely-coupled inter-controller communication in MVC/MVP?

For example, in a Quote, the user must create and add a new contact, or add an existing one.

They choose to create a new contact. When complete, the contact is added to the quote, and the UI returns the user to that quote. If they hit cancel, they are returned to the quote.

I want to re-use Contact elsewhere, thus it should not know anything about Quote. For example, if I create a contact from the contacts list, it should return there when done.

Here are some options that I have thought of:

  • ContactsController action calls ApplicationController.getNextStep(this) and the ApplicationController figures it out the next step on behalf of the ContactsController

  • ContactsController raises “actioncomplete” event or similar, and the ApplicationController is listening for this event, and calls the correct next step

  • QuoteController passes in a “baton” to ContactsController with the next step, which ContactsController calls when done

  • ContactsController raises “actioncomplete” event or similar, and the QuotesController is listening for this event, and calls the correct next step.

Do you have experience with these? Other ideas? Which will cause the fewest headaches in a big app?

Thanks!

  • 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-30T02:11:09+00:00Added an answer on May 30, 2026 at 2:11 am

    Guess I will answer my own question. Hopefully, I get that sweet, sweet bounty.

    Think about this from the perspective of sending your consultant employee out to a customer. He knows how to do his job, but he doesn’t know what to do when he’s finished. You want him to be flexible about what he does next.

    Sometimes his boss sends him out. Sometimes the CEO does (he might not know where to send him after). Sometimes the client calls him in with an emergency (he definitely doesn’t know where to send him after). Sometimes he just grabs a new task from the whiteboard.

    He could do one of several things:

    • you could tell him to call the head office when he’s done, and head office will figure it out for him. he doesn’t need to know about any other people, just the head office phone number.

    • you could tell him what to do when he’s finished, before he leaves. if he’s gone for a while, his next task might have changed in the meantime.

    • you could tell him to post to facebook when he’s done, head office will be looking for it, and will tell him what to do. head office would need to be watching for a lot of facebook posts from all their consultants.

    • you could tell his supervisor to to answer his call when he’s finished, but then his supervisor needs to be in the office, and maybe he’ll switch supervisors.

    Personally, I would pass in a callback function. If that callback is null, the callee should ask the application what to do. That gives you some flexibility, while also allowing for a parent process to manage things, and not relying on one big function in the app.

    This would be equivalent to giving the consultant the number of the next customer to call, when he’s done. If he doesn’t get a number, he calls the head office.

    You could use an event as well, and it’s not a bad idea. The only issue might be if multiple objects are listening for this event, something untoward might happen.

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

Sidebar

Related Questions

How can I select the good method (I have in the example below show
can anyone recommend a good method to create a sha1 salt using javascript ?
Is there a good method to create HD like graphics for regular 480x800 devices
Is there a good method for writing C / C++ function headers with default
What's a good method of programatically generating etag for web pages, and is this
Has anyone found a good method of mocking out ADO.Net Data Service calls from
Is this a good method to save to all index in a variable and
What is a good method to align images together that may have different rotations,
Is there a good method of form security that does not involve CAPTCHA? CAPTCHA
Does anyone know of a good method for editing PDFs in PHP? Preferably open-source/zero-license

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.