单页JavaScript Web应用程序的体系结构?

编程入门 行业动态 更新时间:2024-10-27 19:20:57
本文介绍了单页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.)

-

(这个问题导致了两个使用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 是最优雅的IMO。我从中学到了很多东西。我还发现Nicholas Zakas的可扩展JavaScript应用架构有助于研究客户端架构选项。

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.

另外两个提示

  • 我发现了视图,焦点和输入管理是单页网页应用程序中需要特别注意的领域。
  • 我也发现抽出JS库有助于改变头脑中的所有内容,或者混合使用。匹配应该需要。
  • 更多推荐

    单页JavaScript Web应用程序的体系结构?

    本文发布于:2023-11-11 16:41:07,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1579005.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:体系结构   应用程序   JavaScript   Web

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!