为何选择ASP.NET MVC? [英] Why ASP.NET MVC?

查看:62
本文介绍了为何选择ASP.NET MVC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我碰巧看到这个asp.net MVC教程

http://www.asp.net/learn/mvc/tutorial-01-cs.aspx


的确如此作者说,在本教程的开头,它将在

看起来像经典的ASP。


我认为带有动作的表格帖子(这是经典的asp风格) )喜欢


< form method =" post" action =" / Home / CreateNew">

要发布的表单就在这里。

< / form>


对我来说没关系,但是当我看到嵌入式花括号和ifs以及

其他'里面<%和%>时,我确定我想远离

it。


我认为将代码嵌入<%和%中就像经典ASP和

JSP一样出了名读取并且难以维护,并且错误 -

容易发生。


据我所知,struts的部分功能是嵌入式
$ b JSP中的$ b代码。我不知道为什么人们想用asp.net mvc恢复旧的

编码风格,你的意见很赞赏。


或者是它asp.net

MVC不需要这种嵌入的情况?如果是,那么可能值得研究一下。


我在这个小组中搜索了一下,发现了这个:

http://groups.google.com/group/micro...307ade5b2463d5

解决方案

10月20日, 12:13 * pm,作者< gnewsgr ... @ gmail.comwrote:


我碰巧看到这个asp.net MVC教程

http://www.asp.net /learn/mvc/tutorial-01-cs.aspx


确实如作者所说,它会在

看起来像经典的ASP本教程的开头。


我认为带有动作的表格帖子(这是经典的asp风格)如


< form method =" post" action =" / Home / CreateNew">

*要发布的表单到这里。

< / form>


对我来说没关系,但是当我看到嵌入式花括号和ifs以及

其他内部<%和%>时,我确定我想远离

it。


我认为将代码嵌入<%和%中就像经典ASP和

JSP一样出了名阅读和难以维护,错误 -

倾向。


根据我的理解,struts的部分功能是嵌入式
$ JSP中的b $ b代码。 *我不知道为什么人们想用asp.net mvc恢复旧的

编码风格,你的意见很赞赏。


或者是在asp.net

MVC中,这种嵌入是不必要的? *如果是,那么可能值得研究一下。


我在这个小组中搜索了一下,发现了这个:

http://groups.google.com/group/micro...framework .aspn ...



更正:


< quote>

据我所知,struts的部分功能是在JSP中嵌入

代码。

< / quote>


应该阅读


根据我的理解,struts的部分功能是在JSP中摆脱

嵌入式

代码。


休闲网站开发人员可能会继续使用webforms。你切换到mvc

,当以下任何一个重要到足以切换时:


1)你是单元测试开发人员(使用测试第一设计)

2)尝试使用webforms假和复杂的事件模型。

3)写了很多javascript而且厌倦了id'的变化,并希望

标准的html组件。

4)希望更好地分离视图和控制器代码。

5)想要一个ruby on rails编码体验(mvc更容易使用动态

语言,如ironpython,ironruby或javascript)

6)你被提交到mvc模式,想要一个支持的平台

7)你切换到jQuery(参见#3)

8)你的网站将变得庞大而复杂。

- 布鲁斯(sqlwork.com)

" Author"写道:


10月20日下午12:13,作者< gnewsgr ... @ gmail.comwrote:


我偶然看到这个asp.net MVC教程

http://www.asp.net/learn/mvc/tutorial-01-cs.aspx


的确正如作者所说,在本教程的开头,它将在

看起来像经典的ASP。


我认为带有动作的表格帖子(这是经典的asp风格)喜欢


< form method =" post" action =" / Home / CreateNew">

要发布的表单就在这里。

< / form>


对我来说没关系,但是当我看到嵌入式花括号和ifs以及

其他'里面<%和%>时,我确定我想远离

it。


我认为将代码嵌入<%和%中就像经典ASP和

JSP一样出了名读取并且难以维护,并且错误 -

容易发生。


据我所知,struts的部分功能是嵌入式
$ b JSP中的$ b代码。我不知道为什么人们想用asp.net mvc恢复旧的

编码风格,你的意见很赞赏。


或者是它asp.net

MVC不需要这种嵌入的情况?如果是,那么可能值得研究一下。


我在这个小组中搜索了一下,发现了这个:

http://groups.google.com/group/micro...framework。 aspn ...



更正:


< quote>

根据我的理解,struts的部分功能是在JSP中嵌入

代码。

< / quote>


应该阅读


根据我的理解,struts的部分功能是在JSP中摆脱

嵌入式

代码。


10月20日下午2:17 *,布鲁斯巴克

< brucebar ... @ discuss.microsoft。 comwrote:


休闲网页开发人员可能会留下网络表格。你切换到mvc

,当以下任何一个重要到足以切换时:


1)你是单元测试开发人员(使用测试第一设计)

2)尝试使用webforms假和复杂的事件模型。

3)写了很多javascript而且厌倦了id'的变化,并希望

标准的html组件。

4)希望更好地分离视图和控制器代码。 *

5)想要一个ruby on rails编码体验(mvc更容易使用动态

语言,如ironpython,ironruby或* javascript)

6)你被提交到mvc模式,并想要一个支持的平台

7)你切换到jQuery *(见#3)

8)你的网站正在运行大而复杂。


- 布鲁斯(sqlwork.com)


" Author"写道:


10月20日下午12:13,作者< gnewsgr ... @ gmail.comwrote:


我碰巧在
看到这个asp.net MVC教程


> http://www.asp.net/learn/ mvc / tutorial-01-cs.aspx


确实如作者所说它会看起来就像本教程开头的

中的经典ASP一样。


我觉得带有动作的表格帖子(这是经典的asp风格),比如


< form method =" post" action =" / Home / CreateNew">

*要发布的表单在这里。

< / form>


对我来说没关系,但是只要看到嵌入式花括号和ifs和

其他'的内部<%和%>,我确定我想远离

它。


我认为将代码嵌入<%和%中,就像经典ASP和
JSP是众所周知的难以阅读和难以维护,并且错误 -

容易发生。


根据我的理解,struts的部分功能是嵌入
$ JSP中的b $ b代码。 *我不知道为什么人们想用asp.net mvc恢复旧的

编码风格,你的意见很感激。


或者这样的情况是asp.net不需要这样的嵌入

MVC? *如果是,那么可能值得研究一下。


我在这个组中搜索了一下,发现:


> http://groups.google.com/group/micro...framework.aspn ....


更正:


< quote>

根据我的理解,struts的部分功能是在JSP中嵌入

代码。

< / quote>


应该是


根据我的理解,struts的一部分' '功能是在JSP中摆脱

嵌入式
代码。



非常感谢您的分享。你能说一下ASP.NET MVC的主要劣势吗?


另外,有没有办法避免在<%和%内嵌入代码? >?


非常感谢。


I happened to see this asp.net MVC tutorial at

http://www.asp.net/learn/mvc/tutorial-01-cs.aspx

Indeed as the author says it is gonna look like classic ASP at the
very beginning of this tutorial.

I think form post with an action (which is classic asp style) like

<form method="post" action="/Home/CreateNew">
the form to be posted goes here.
</form>

is OK to me, but as soon as I see embedded curly braces and ifs and
else''s inside <% and %>, I am determined that I wanna stay far from
it.

I think embedding codes inside <% and %like that of classic ASP and
JSP is notoriously hard to read and difficult to maintain, and error-
prone.

To my understanding, part of struts'' functionality is to embedded
codes in JSP. I don''t know why people wanna revert back to the old
coding style with asp.net mvc and your input is appreciated.

Or is it the case that such embeddings are not necessary with asp.net
MVC? If yes, then it may be worth looking into a little.

I searched a little in this group and found this:

http://groups.google.com/group/micro...307ade5b2463d5

解决方案

On Oct 20, 12:13*pm, Author <gnewsgr...@gmail.comwrote:

I happened to see this asp.net MVC tutorial at

http://www.asp.net/learn/mvc/tutorial-01-cs.aspx

Indeed as the author says it is gonna look like classic ASP at the
very beginning of this tutorial.

I think form post with an action (which is classic asp style) like

<form method="post" action="/Home/CreateNew">
* the form to be posted goes here.
</form>

is OK to me, but as soon as I see embedded curly braces and ifs and
else''s inside <% and %>, I am determined that I wanna stay far from
it.

I think embedding codes inside <% and %like that of classic ASP and
JSP is notoriously hard to read and difficult to maintain, and error-
prone.

To my understanding, part of struts'' functionality is to embedded
codes in JSP. *I don''t know why people wanna revert back to the old
coding style with asp.net mvc and your input is appreciated.

Or is it the case that such embeddings are not necessary with asp.net
MVC? *If yes, then it may be worth looking into a little.

I searched a little in this group and found this:

http://groups.google.com/group/micro...framework.aspn...

Correction:

<quote>
To my understanding, part of struts'' functionality is to embedded
codes in JSP.
</quote>

should read

To my understanding, part of struts'' functionality is to get rid of
embedded
codes in JSP.


casual web developers will probably stay with webforms. you switch to mvc
when any of the following are important enough to switch:

1) you are unit test developer (use test first design)
2) are tried of webforms "fake" and complex event model.
3) are writing lots of javascript and tired of id''s changing, and want
standard html components.
4) want better seperation of view and controller code.
5) want a ruby on rails coding experience (mvc is easier with a dynamic
language like ironpython, ironruby or javascript)
6) you are commited to the mvc pattern, and want a supported platform
7) you switched to jQuery (see #3)
8) your web site is going to be large and complex.
-- bruce (sqlwork.com)
"Author" wrote:

On Oct 20, 12:13 pm, Author <gnewsgr...@gmail.comwrote:

I happened to see this asp.net MVC tutorial at

http://www.asp.net/learn/mvc/tutorial-01-cs.aspx

Indeed as the author says it is gonna look like classic ASP at the
very beginning of this tutorial.

I think form post with an action (which is classic asp style) like

<form method="post" action="/Home/CreateNew">
the form to be posted goes here.
</form>

is OK to me, but as soon as I see embedded curly braces and ifs and
else''s inside <% and %>, I am determined that I wanna stay far from
it.

I think embedding codes inside <% and %like that of classic ASP and
JSP is notoriously hard to read and difficult to maintain, and error-
prone.

To my understanding, part of struts'' functionality is to embedded
codes in JSP. I don''t know why people wanna revert back to the old
coding style with asp.net mvc and your input is appreciated.

Or is it the case that such embeddings are not necessary with asp.net
MVC? If yes, then it may be worth looking into a little.

I searched a little in this group and found this:

http://groups.google.com/group/micro...framework.aspn...


Correction:

<quote>
To my understanding, part of struts'' functionality is to embedded
codes in JSP.
</quote>

should read

To my understanding, part of struts'' functionality is to get rid of
embedded
codes in JSP.


On Oct 20, 2:17*pm, bruce barker
<brucebar...@discussions.microsoft.comwrote:

casual web developers will probably stay with webforms. you switch to mvc
when any of the following are important enough to switch:

1) you are unit test developer (use test first design)
2) are tried of webforms "fake" and complex event model.
3) are writing lots of javascript and tired of id''s changing, and want
standard html components.
4) want better seperation of view and controller code. *
5) want a ruby on rails coding experience (mvc is easier with a dynamic
language like ironpython, ironruby or *javascript)
6) you are commited to the mvc pattern, and want a supported platform
7) you switched to jQuery *(see #3)
8) your web site is going to be large and complex.

-- bruce (sqlwork.com)

"Author" wrote:

On Oct 20, 12:13 pm, Author <gnewsgr...@gmail.comwrote:

I happened to see this asp.net MVC tutorial at

>http://www.asp.net/learn/mvc/tutorial-01-cs.aspx

Indeed as the author says it is gonna look like classic ASP at the
very beginning of this tutorial.

I think form post with an action (which is classic asp style) like

<form method="post" action="/Home/CreateNew">
* the form to be posted goes here.
</form>

is OK to me, but as soon as I see embedded curly braces and ifs and
else''s inside <% and %>, I am determined that I wanna stay far from
it.

I think embedding codes inside <% and %like that of classic ASP and
JSP is notoriously hard to read and difficult to maintain, and error-
prone.

To my understanding, part of struts'' functionality is to embedded
codes in JSP. *I don''t know why people wanna revert back to the old
coding style with asp.net mvc and your input is appreciated.

Or is it the case that such embeddings are not necessary with asp.net
MVC? *If yes, then it may be worth looking into a little.

I searched a little in this group and found this:

>http://groups.google.com/group/micro...framework.aspn....

Correction:

<quote>
To my understanding, part of struts'' functionality is to embedded
codes in JSP.
</quote>

should read

To my understanding, part of struts'' functionality is to get rid of
embedded
codes in JSP.

Thank you very much for sharing. Could you say something about the
main disadvantage of ASP.NET MVC?

Also, is there a way to avoid embedding codes inside <% and %>?

Thanks a lot.


这篇关于为何选择ASP.NET MVC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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