Architecture of a single-page JavaScript web application?

Posted by fig-gnuton on Stack Overflow See other posts from Stack Overflow or by fig-gnuton
Published on 2010-06-16T05:16:43Z Indexed on 2010/06/16 5:22 UTC
Read the original article Hit count: 208

How should a complex single-page JS web application be structured on the client-side? Specifically I'm curious about how to cleanly structure the application in terms of its model objects, UI components, any controllers, and objects handling server persistence.

MVC seemed like a fit at first. But with UI components nested at various depths (each with their own way of acting on/reacting to model data, and each generating events which they themselves may or may not handle directly), it doesn't seem like MVC can be cleanly applied. (But please correct me if that's not the case.)

--

(This question resulted in two suggestions of using ajax, which is obviously needed for anything other than the most trivial one-page app.)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about design-patterns