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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:15:54+00:00 2026-05-10T14:15:54+00:00

How is your javaScript code organized? Does it follow patterns like MVC, or something

  • 0

How is your javaScript code organized? Does it follow patterns like MVC, or something else?

I’ve been working on a side project for some time now, and the further I get, the more my webpage has turned into a full-featured application. Right now, I’m sticking with jQuery, however, the logic on the page is growing to a point where some organization, or dare I say it, ‘architecture’ is needed. My first approach is ‘MVC-ish’:

  • The ‘model’ is a JSON tree that gets extended with helpers
  • The view is the DOM plus classes that tweak it
  • The controller is the object where I connect events handling and kick off view or model manipulation

I’m very interested, however, in how other people have built more substantial javaScript apps. I’m not interested in GWT, or other server-oriented approaches… just in the approach of ‘javaScript + <generic web service-y thingy here>’

Note: earlier I said javaScript ‘is not really OO, not really functional’. This, I think, distracted everyone. Let’s put it this way, because javaScript is unique in many ways, and I’m coming from a strongly-typed background, I don’t want to force paradigms I know but were developed in very different languages.

  • 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. 2026-05-10T14:15:54+00:00Added an answer on May 10, 2026 at 2:15 pm

    ..but Javascript has many facets that are OO.

    Consider this:

    var Vehicle = jQuery.Class.create({     init: function(name) { this.name = name; }  });  var Car = Vehicle.extend({     fillGas: function(){        this.gas = 100;     }  }); 

    I’ve used this technique to create page-level javascript classes that have their own state, this helps keep it contained (and I often identify areas that I can reuse and put into other classes).

    This is also especially useful when you have components/server controls that have their own script to execute, but when you might have multiple instances on the same page. This keeps the state separate.

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

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Get "Cocoa Programming for Mac OS X by Aaron Hillegass"… May 11, 2026 at 11:46 pm
  • Editorial Team
    Editorial Team added an answer I think AppData is what you want. You can use… May 11, 2026 at 11:46 pm
  • Editorial Team
    Editorial Team added an answer After adding the field again, you need to call .datepicker… May 11, 2026 at 11:46 pm

Related Questions

I do a lot of custom applications at work. I'm trying to define some
I'm currently a .NET developer, but I'm starting to work with Flex a little
To start out, I have looked at the following pages and don't quite have
How would one get resx resource strings into javascript code stored in a .js

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.