MVC前端和MVC后端:错误的架构? [英] Mvc Front-end and Mvc Back-end: wrong architecture?

查看:141
本文介绍了MVC前端和MVC后端:错误的架构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个网络应用程序,这将是一个Twitter风格的单页的应用程序,可能的用户身份验证。的相互作用的80%发生在前端用JavaScript,和与谁应答来自分贝提供数据后端的帮助...

I am building a web-application that will be a twitter style one-page app, possibly with user authentication. 80% of the interactions happen in the front-end with JavaScript, and with the help of a backend who answers providing data from the db...

到现在为止我的想法是使用Symfony2的,再加上像骨干或灰烬(preFER灰烬,因为它似乎更证明和一般更有条理,更容易)前端MVC框架。

Until now my thought was to use Symfony2, plus an MVC framework for the front-end like Backbone or Ember (prefer Ember as it seems more documented and in general more organized and easier).

当我进入学习Symfony2中,它来到我的注意,许多与Symfony2中提供的东西是没有用我的应用程序。我并不真的需要它的意见意见将要使用JavaScript模板,我并不真的需要它的路由器无论是作为将还与国家的前端处理与JS ..

While I was getting into learning Symfony2, it came to my attention that many of the things that Symfony2 offers are of no use for my app. I don't really need its' views as views are going to be templated with Javascript, and I don't really need it's routers either as that will be also handled with states with JS on the front-end..

Symfony2中只会被用作JSON响应的机制,我想学说也可以帮助别人谁是主要不是后端的家伙能够轻而易举地完成查询,当然了身份验证。我猜形式也由JavaScript处理。

Symfony2 will only be used as a JSON-responding mechanism, I guess doctrine also helps someone who's not primarily a back-end guy to do the queries easily, and of course for the Authentication. I guess FORMS are also handled by JavaScript.

我见过很多关于Symfony2中和骨干等问题,平安,等方面有许多不同的答案,有人说你需要一个包来创建RESTful API中(为什么?) - 别人说你需要捆绑的完整集成骨干/ Symfony2中的,别人说你只需要使用Symfony2的查询JSON数据和序列化他们,送他们回来,所以没有什么特别的。

I've seen lots of other questions regarding Symfony2 and backbone, RESTful, etc. There are many different answers, some say you need a Bundle to create RESTful APIs (why?) - others say you need Bundle for the complete Integration of Backbone/Symfony2, others say you just need to query JSON data with Symfony2 and Serialize them and send them back, so nothing special..

我的问题是:好像Symfony2的是这种应用程序的矫枉过正。但考虑到这是一个机会学习的项目,是不是真的有问题? (性能明智的,或不与前端打得很好)。而subquestion到,你可以提供的Symfony2的任何工作的例子具有单页web应用程序集成?我已经看到了不同的元素,但没有作为一个整体,所以我可以知道我究竟想达到code-明智的。

So my question is: Seems like Symfony2 is an overkill for this kind of APP. But considering this is an opportunity-to-learn project, is it really a problem? (performance-wise, or not playing well with the Front-End). And the subquestion to that is, can you provide of any working example on Symfony2 integrated with an one-page web-app? I've seen different elements, but nothing as a whole so I can know what am I trying to achieve code-wise.

推荐答案

我不知道,但Symphony2听起来很像余烬最导轨+项目。这些应用程序使用很少的Rails框架的。一个可以使该打火机框架是更适合,但不应该是一个问题的情况。更重要的是可能它会在您的部分学习2个新的框架,在一次电梯。如果打算W¯¯烬我会通过构建一个使用余烬灯具适配器没有后端所有的MVP启动。一旦你的工作,你可以将其插入任何框架很有意义。火了起来Ember.js窥视code展示了如何构建一个应用程序这种方式。

I don't know Symphony2 but sounds a lot like most ember+rails projects. These apps use very little of the rails framework. One could make the case that a lighter framework is a better fit but shouldn't be a problem. More important is probably the lift it will take on your part to learn 2 new frameworks at once. If going w ember I would start by building an MVP that uses the ember fixture-adapter has no backend at all. Once you've got that working you can plug in whatever framework makes sense. The Fire Up Ember.js peepcode shows how to build an app this way.

这篇关于MVC前端和MVC后端:错误的架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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