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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:05:39+00:00 2026-06-04T06:05:39+00:00

R: 1 They are not mutually exclusive as stated in this SO Post This

  • 0

R:1

They are not mutually exclusive as stated in this SO Post

This is a specific question related to this more general SO Post

However a controller is suppose to route all calls from the User. I do this by initializing my elements ( setting the addEventListener ) and having them call the Model.

For example: ( from my control object )

signin_input.addEventListener( "keypress", function( event )
{ 
    if( event.keyCode === 13 )
    {
        new ModelType( 'signin' ).invoke();
        return false; 
    }

}, false );

But as my site grows my Controller is getting big.

One thing I could do is move initialization into it’s respective module. For example my Sign In logic is in an object called ModelType. The initialization is in the object Control.

To reduce the size of Control I could move initialization into ModelSignIn.

Or I could just break up my Controller Object into multiple objects – ControlPage1, ControlPage2, etc.

Which way is best or what other way is best?

One benefit to moving initialization into the correlative object is that now the object is self contained and you can copy paste it into other applications. Downside is that this seems to break the MVC pattern.

  • 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-04T06:05:41+00:00Added an answer on June 4, 2026 at 6:05 am

    Since it has been several days and no one else has offered an answer, I will give it a shot.
    While I haven’t tried using an MVC pattern with JavaScript, I have used it for PHP, so perhaps it would work for your framework too.

    For the MVC I designed in PHP, I use htaccess to route all php files through the index which loads the default controller (basic controller framework) and then uses the requested filename to see if there are any sub-controllers (which may or may not override certain functions or attributes of the default).

    The controller will load the default model and view (and any sub-model/sub-view related to the requested page).

    I use this as a way to keep the main controller from becoming cluttered. Perhaps it’s not a true MVC pattern, but it has served me well for the past 5 years or so.

    enter image description here

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

Sidebar

Related Questions

I looked at previous post based on this but they do not relate. I
I would like to know a few practical use-cases (if they are not related/tied
Read this question carefully because I am not asking how to get rid of
When I define this CSS in HTML I found that they not show me
In a previous question: Embedded fonts in iOS: why are they not centered correctly
This applies to subclasses of Applet, Servlet, Midlet, etc. Why do they not need
I have a question about pthread_wrlock_wrlock and pthread_wrlock_rdlock: Are they not implemented as spin
I know they do not hold across pattern matches (i.e. you need to rewrite
I have two ASP.NET sites (they can not run in the same process) and
I've read some of the articles on MSDN but they're not quite what I

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.