首页 > Web开发 > 详细

ASP.Net Mvc 5 学习记录2015-9-9

时间:2015-09-10 00:30:20      阅读:297      评论:0      收藏:0      [点我收藏+]

我之前一直都是学习和开发都采用ASP.Net WebForm,对MVC的一直都是一知半解,最初以为ASP.Net WebForm的N层架构就是MVC。其实N层架构设计思想是"高内聚,低耦合",也就是解耦,而非MVC的设计思想。

学习ASP.NET MVC感觉还是主要还是了解它的设计思想和设计理念。ASP.NET MVC与ASP.ENT WebForm的设计理念完全是不同的,而以前一直采用ASP.ENT WebForm编写网站。ASP.NET WebForm的2大特点:可视化布局和事件驱动。

学习ASP.Net Mvc 5,我主要还是在网络上看看别人写的文章,查看MSDN,http://www.asp.net/mvc官方网站,然后编写代码加强学习。

下面来谈谈我对ASP.Net Mvc 的认识。

What?

什么是ASP.Net Mvc。MSDN给出的官方解释是:The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating Web applications. The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc assembly.

ASP.Net Mvc,ASP.Net 是实现的技术,MVC是设计思想。技术可以不断提高,但思想是它的灵魂。

ASP.Net Mvc 分为主要3个模块,模型-视图-控制器(Model-View-Controller)。

技术分享

模型,数据模型。一个数据表对应一个模型类。在ASP.Net Mvc 中,采用了EntityFrameWork的 Code Fisrt,我们可以很容易的得到数据模型类。

视图,简单的说就是页面,用于交互。

控制器,MVC的核心,控制器用于处理视图和模型。

ASP.Net Mvc 的项目结构。

技术分享

今天就写到这了。

学习ASP.Net Mvc5的主要资源网站:

http://www.cnblogs.com/powertoolsteam/p/MVC_knowledge.html

http://www.asp.net/mvc

http://kb.cnblogs.com/zt/mvc/

http://www.it-ebooks.info/

ASP.Net Mvc 5 学习记录2015-9-9

原文:http://www.cnblogs.com/heshengli/p/4796390.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!