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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:05:51+00:00 2026-06-06T15:05:51+00:00

I am trying for several days to find a reason to use MVC pattern

  • 0

I am trying for several days to find a reason to use MVC pattern in both the client and the server.
I am currently using an MVC framework on the server-side and I have created a RESTfull api.
I have created the templates using jsrender

<script id="housestemplate" type="text/x-jquery-tmpl">
    <li><a href="#" onclick="gethouse({{:house.id}});">
        <h3>{{:house.house_type.type}}</h3>
        <p>{{:house.area}} {{:house.bedroom_num}}</p></a>
</script>

and then I use ajax to retrieve and populate the templates

        $.ajax
        ({
            type:"GET",
            url: url ,
            success:function (data) {
                $("#renderHouse").html($("#housestemplate").render(data));
            }
        });

How can an Javascript MVC framework improve this functionality without breaking the DRY rule with models and views(templates) repeating in client and server code?

  • 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-06T15:05:53+00:00Added an answer on June 6, 2026 at 3:05 pm

    For that particular example it is definitely an overkill and you are better off with simple javascript/jquery.

    However, increase the amount of javascript/jquery to about 500 lines. How does it look? Manageable? How about 1000-2000 LOC? Now you’ll wish that you had all code organized as objects (classes 🙂 and methods who can talk to each other like how the backend services are organized. Hmmm…so what? Well backbone.js to the rescue! It helps organize your code into the MVC(C) paradigm (the latter C being Collection). So you get code organization and event driven communication as part of the framework and you’d have wished the prior 2k lines of code were initially organized that way to begin with.

    So, what does backbone give you? Code organization and prevention from spaghetti. In fact you could use UML like analysis (class diagrams etc.) to analyze and design the ‘front-end’ of your application and make it more maintainable.

    So the question you want to ask is, is it worth it? Well that depends on the amount of javascript you expect and the extent/size of your front-end. It does help to think of client/server as running in different realms as @jakee pointed out.

    Best of luck!

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

Sidebar

Related Questions

I've been trying to find a proper solution to my problem for several days
I'm trying for several days to simulate a non-deterministic finite automata, using a map
since several days I am trying to find a memory bug in my software.
I have been trying for several days to get the proper formatting for what
Good day - several days have passed while i was trying to transport my
Last several days I was trying to set up a proper local SVN (with
I've been tearing my hair out for several days now trying to figure out
I've been trying for several days to: set the value of the variable w
I've spent several days trying to figure out what is wrong with my android
I've been trying to figure out how to do this for several days now

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.