我的 CMS 应用程序的 Javascript 架构
我正在构建一个 CMS,其中将具有一些使用 Javascript/Ajax 作为分页、搜索(均使用 ajax)的功能以及一些功能,如图像裁剪和其他功能(不使用 ajax)。
我的应用程序不是单页应用程序,我正在寻找 Javascript 的架构解决方案,其中涉及未来维护的关注点分离。
我正在研究 MVC 解决方案,例如 Backbone.js、Spine.js、Dojo Toolkit 和 Pub/Sub 模式,但我不知道这些解决方案是否适合我的应用程序,但是,可能是大型解决方案我不需要的大量资源。
有人可以帮助我并向我指出一个简单且不太复杂的解决方案(带有代码的示例更好),该解决方案侧重于关注点分离?
(就像我说的,我将使用简单的 Javascript 功能,例如使用 ajax 进行分页和搜索,以及一些功能,例如图像裁剪、表单验证、ajax 网格和 jquery 插件)
我知道 jQuery 对于 DOM 操作非常有用,但是,只有 jQuery 不擅长无法提供良好的架构解决方案,我可以将什么与 jQuery 结合起来以获得良好的架构/分离?
I'm building a CMS in which will have some features using Javascript/Ajax as paging, searches (both using ajax) and some features like image crop and others (without ajax).
My app is not a Single Page Application, I'm looking for a architectural solution of my Javascripts which involves the separation of concerns for the future maintenance.
I was taking at look at MVC solutions like Backbone.js, Spine.js, Dojo Toolkit and Pub/Sub Pattern, but I don't know if these solutions is the way to go in my app, however, may be solutions with large amounts of resources that I do not need.
Someone can help me and indicate me a simple and not much complex solution (a EXAMPLE with code is much better) which focus in separation of concerns?
(Like I was saying I'll use simple Javascript features like paging and searches with ajax and some features like image crop, forms validation, ajax grids and jquery plugins in general)
I know jQuery is great for DOM manipulation, however, only jQuery don't serve a good architectural solution, What I might be combining with jQuery for a good architecture/separation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您正在寻找大规模 JavaScript 开发的参考架构,请查看 BoilerplateJS。它不是一个库,而是包含用于复杂产品开发的示例的启动代码库。正如您所问,它展示了
的最佳实践以及更多架构问题。我写这篇文章是为了分享我在一些复杂的 JS 产品中获得的经验。
http://boilerplatejs.org
If you are looking for a reference architecture for large scale javascript development, have a look at BoilerplateJS. It is not a library, but startup codebase with samples for complex product development. As you asked, it shows best practices of
And many more architectural concerns. I wrote it to share my experience which I gained doing couple of complex JS products.
http://boilerplatejs.org
如果您正在创建一个单页应用程序,那么像 Knockout.js 这样的东西就很棒。如果您正在制作一个具有类似应用程序功能的网站,那么使用 jQuery 的框架通常会更好。在这种情况下,请选择 Backbone.js(还有其他)之类的
框架。您应该尝试几种不同的框架,看看您最喜欢哪一个最适合您的网站/应用程序。我知道这不是一个很好的答案,但不同的应用程序有不同的需求。
If you are creating an one page application something like Knockout.js is great. If you are making a website with app like features a framework that uses jQuery is mostly better. In that case go for something like Backbone.js (there are others)
You should try a few different frameworks and see which one you like best for you website/application. I know this isn't a great answer but different applications have different needs.