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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:37:17+00:00 2026-05-27T04:37:17+00:00

I am trying to build a program using model-view-controller. Specifically: I have a state

  • 0

I am trying to build a program using model-view-controller.

Specifically:

I have a state manager that handles (initializing, loading, running, unloading etc… of) a set of MVCs, one at a time.

In each set, the single controller contains a reference to the relevant model and views.

Every model, view and controller are each derived from a parent class.
(i.e. abstract model, abstract view, abstract controller).
This allows me to keep much of the process in the parent classes, rather than adding duplicate code in each specific mvc set the state manager will handle.

Now the idea is for each View to call on its Controller methods, which in turn will call on its Model methods, and any resulting changes in the Model will be communicated back to the View through the Controller.

This is where I’m stuck. The only knowledge each view and model have of the controller is what is defined in its parent class. Which of course does not include the very specific methods the child-controller will need in order to properly handle the views and model.

Are there any ideas on how I can deal with this?

-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-27T04:37:18+00:00Added an answer on May 27, 2026 at 4:37 am

    You are probably closer to MVP than MVC. Anyway, getting around your problem may be possible using interfaces and generics.

    Have your abstract classes take a generic interface:

    public abstract class BaseView<TController>
    {
        protected TController Controller { get; private set; }
    
        protected BaseView(TController controller)
        {
           Controller = controller;
        }
    }
    

    Something to that effect.

    Then your specific controller will simply implement the relevant interface.

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

Sidebar

Related Questions

I'm trying to build a web app using Dojo. I have a form that
I am trying to build a server program that receives file from client using
I am trying to build a program using the command scons compiler = msvc.
I'm trying to build a small program that hosts vst effects and I would
I'm trying to build a program I've written in C using GNU autotools, but
I'm trying to build a video chat program using Adobe Flex but there is
I am trying to build a very simple C++ program using the Maven NAR
I am trying to build a program for a school assignment that generates transitive
I am trying to build a C# program that converts a different language into
I'm trying to build a test suite program (using JRE 1.6 under Eclipse IDE,

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.