w*******7 发帖数: 188 | 1 MVC中的frontend对应的是client side 吗?
backend对应的是Server Side吗?
在stackoverflow提到了area的概念,是否Admin和Member都是属于backend(server
side)? 而site则是属于frontside (client side)?
http://stackoverflow.com/questions/11923149/asp-mvc-front-end-b
而在有的MVC的书里,又感觉M(MODEL)和C(Controller)是Server side,View则是
Client side,概念很混乱?希望大牛可以指点迷津!!! | s***o 发帖数: 2191 | 2 "Backend" is the place where you take care of the business logic and
infrastructure including data access, authentication, etc. They are usually
built as separate modules from your mvc Web project. (server side)
The functionalities of the "backend" are usually available through various "
services". (server side)
"Fontend" is more about UI, about how you present information to end users,
e.g., HTML markup (in the "view"s), CSS, JS modules related to the UI logic,
etc. (client side)
Consider a controller as a "gateway". It listens to user input; grab
necessary "model"s through "services" based on the specific user input; then
select the appropriate "view" and dispatch it in client's browser. (server
side, but could be considered as part of the "front end")
In many cases, it's awkward or even impossible to use domain models directly
in your views, the "model" here in MVC is more about view models. | w*******7 发帖数: 188 | | u**********a 发帖数: 448 | 4 Thanks so much.
usually
"
,
logic,
.
【在 s***o 的大作中提到】 : "Backend" is the place where you take care of the business logic and : infrastructure including data access, authentication, etc. They are usually : built as separate modules from your mvc Web project. (server side) : The functionalities of the "backend" are usually available through various " : services". (server side) : "Fontend" is more about UI, about how you present information to end users, : e.g., HTML markup (in the "view"s), CSS, JS modules related to the UI logic, : etc. (client side) : Consider a controller as a "gateway". It listens to user input; grab : necessary "model"s through "services" based on the specific user input; then
| H*******g 发帖数: 6997 | 5 哈哈,楼上的大牛已经解释的灰常好了。
我就多嘴再磨叽几句好啦。
VIEW就是你放HTML, JS, CSS的地方,当然如果你愿意你也可以直接放C# CODE。
MODEL你可以理解成是最底层。CONTROLLER是连接MODEL和VIEW的中间层。现有的教程都
是一个SOLUTION里就放了一个PROJECT,然后这个PROJECT里有M, V, C。实际上是一个
SOLUTION里,你想放多少个PROJECT都可以,每个PROJECT提供不同的功能,然后ADD
REFERENCE.
甚至是你都可以单独写一个PROJECT来放CONTROL,然后再单独写一个PROJECT来放VIEW
。呵呵,随便你怎么整了。
AREA其实没啥特殊的,理解成一种ORGANIZE的方式就好了。 |
|