是服务器端的MVC框架的单页应用还有用吗?服务器端、有用吗、框架、MVC

2023-09-13 03:00:07 作者:最新伤感名字设计

在使用角单页的应用程序,这似乎是大多数的东西都在客户端进行处理。客户端似乎只是让到服务器宁静的电话。

In a single-page application that uses Angular, it seems like most of the things are handled on the client-side. The client seems to just make restful calls to the server.

根据这一概念,在我看来,我的服务器端将不会有任何的应用程序在所有,但只生成REST风格的JSON数据在客户端脚本读取。

Following this concept, it seems to me that my server-side will not have any application at all, but only scripts that generate RESTful json data for the client to read.

如Hibernate或那些连接到数据库仍然适用,因为在服务器上的宁静脚本将仍然有连接到数据库也许框架。但对于那些MVC框架?

Perhaps frameworks like Hibernate or those that connects to the database are still relevant since the restful scripts on the server are going to still have to connect to the DB. But what about those MVC frameworks?

由于在单页的应用程序服务器只需要服务客户端REST风格的调用,框架,如Spring,Struts的(在Java中)或Laravel(在PHP)等,它们都是不相关的SPA?这意味着在服务器端将可能只需要,我们可以一起工作,以服务JSON数据的好REST风格的图书馆,这一切?否则,你会的意见和控制器是在SPA的服务器上?

Since in a single-page app the server is only required to serve RESTful calls for the client, frameworks such as Spring, Struts (in Java) or Laravel (in PHP), etc, they all are not relevant to SPAs? Which means the server side will probably just need a good RESTful library that we can work with to serve the json data and that's all? Otherwise, what would the views and controllers be on the server in a SPA?

推荐答案

我觉得MVC框架仍然是有用到SPA的应用程序。我开发一个应用程序SPA,和我使用的ASP .NET MVC两件事情:

I think that the MVC frameworks are still useful into an SPA application. I am developing a SPA application, and I am using ASP .NET MVC for two things:

要管理我的应用程序的第一页。它可以让我利用这个框架的优点,如用于管理连接和脚本的微小设施。

To Manage the first page of my application. It allows me to make use of the advantages of this framework such as the facilities for managing joining and minification of scripts.

要返回我正在使用角的部分景色。它可以让我用剃刀模板,同时也为如何管理部分观点有传染性的。

To return the partial views that I am using in Angular. It allows me to use the razor templating, and also to manage how the partial views are catching.

我认为,如果你同时使用两种东西,你可以得到一些好处。

I think that you can get some advantages if you mix the two things.

我希望它能帮助。