单页JavaScript的Web应用程序的架构? [英] Architecture of a single-page JavaScript web application?

查看:156
本文介绍了单页JavaScript的Web应用程序的架构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应如何复杂的单页面JS Web应用程序中的客户端构成的?具体来说,我很好奇如何在它的模型对象,UI组件,任何控制器和对象处理服务器的持久性方面清晰地构造应用程序。

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似乎像一个适合在第一。但随着嵌套在不同深度的UI组件(每个都有自己的行事/反应数据模型的方式,每产生他们自己可能会或可能不会直接处理的事件),它似乎并不像MVC可以干净地应用。 (但请纠正我,如果事实并非如此。)

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.)

-

(<一个href=\"http://stackoverflow.com/questions/2529722/suggestions-for-single-page-web-application-design\">This问题导致用ajax,这显然需要比最琐碎的单页的应用程序以外的任何其他的两点建议。)

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

推荐答案

MVC的 PureMVC的/ JS 是最优雅的海事组织。我从中学到了很多东西。我还发现可扩展的JavaScript应用程序架构通过尼古拉斯Zakas有帮助在研究客户端架构的选择。

MVC architecture of PureMVC/JS is the most elegant IMO. I learned a lot from it. I also found Scalable JavaScript Application Architecture by Nicholas Zakas helpful in researching client side architecture options.

另外两个提示


  1. 我发现观,突出重点,并输入管理都需要在单个页面的Web应用程序特别重视的领域

  2. 我还发现它有助于抽象掉JS库,使门打开来改变你用什么心态,或混合&放大器;比赛在有需要时。

这篇关于单页JavaScript的Web应用程序的架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆