不过有意思的是,我把 BLL 和 DAL 都扔掉了.这话是什么意思?
解决方案 »
- 现在弄winform和asp.net的开发,但是就是还想学门新的语言,建议学点什么好呢?
- ASP.NET画曲线图,求示例或文档
- datalist嵌套,第二层默认隐藏,紧急求助!!
- WebForm调用WebService操作Cookie
- IIS安装过程中需要connect.asp文件,但在Windows安装得胜回朝中找不到该问题
- 同一个问题,再发贴 WEB ASPX 下 按<编辑>按钮 后 DataGrid 的定位问题
- 动态导航的问题,有难度
- 使用customvalidator的过程中遇到的问题
- 可不可以用代码修改datagrid的样式,比如从有自动套用的样式编程使没有自动应用的样式
- 访问aspx页面的时候出来这个错误是什么问题?
- 请各位大侠介绍几本好书!!
- 怎么插入一段 javascript?
MSPetShop 3.0 是有 BLL 和 DAL 那几个工程的.
我把这些东西全部扔了.也就是说,修改后的 PetShop 只有一层.
IE提示:“/LPetShop”应用程序中的服务器错误。
--------------------------------------------------------------------------------找不到文件或程序集名称“PetShop.Model”,或找不到它的一个依赖项。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.IO.FileNotFoundException: 找不到文件或程序集名称“PetShop.Model”,或找不到它的一个依赖项。源错误: 执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 程序集加载跟踪: 下列信息有助于确定程序集“PetShop.Model”无法加载的原因。
=== Pre-bind state information ===
LOG: DisplayName = PetShop.Model, Version=3.2.1.0, Culture=neutral, PublicKeyToken=a7987b61c51ca872
(Fully-specified)
LOG: Appbase = file:///E:/LPetShop
LOG: Initial PrivatePath = bin
Calling assembly : LPetShop, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.
===LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file (D:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet.config).
LOG: Using machine configuration file from D:\WINNT\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: PetShop.Model, Version=3.2.1.0, Culture=neutral, PublicKeyToken=a7987b61c51ca872
LOG: Attempting download of new URL file:///D:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/lpetshop/7456e832/b44b1c41/PetShop.Model.DLL.
LOG: Attempting download of new URL file:///D:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/lpetshop/7456e832/b44b1c41/PetShop.Model/PetShop.Model.DLL.
LOG: Attempting download of new URL file:///E:/LPetShop/bin/PetShop.Model.DLL.
LOG: Attempting download of new URL file:///E:/LPetShop/bin/PetShop.Model/PetShop.Model.DLL.
LOG: Attempting download of new URL file:///D:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/lpetshop/7456e832/b44b1c41/PetShop.Model.EXE.
LOG: Attempting download of new URL file:///D:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/lpetshop/7456e832/b44b1c41/PetShop.Model/PetShop.Model.EXE.
LOG: Attempting download of new URL file:///E:/LPetShop/bin/PetShop.Model.EXE.
LOG: Attempting download of new URL file:///E:/LPetShop/bin/PetShop.Model/PetShop.Model.EXE.
?
如果再失去使用价值,,,,,,,,,,,,,,,,,,,,,,
总之,支持,顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶
虽然三层结构去了,但是 MVC 模式还在的 (M 是 PetShop.Modal 下的对象类 , V 是 *.aspx+*.ascx , C 是 AccountController和CartController )设计Modal是很容易的.我想大家都能针对PetShop想出那些对象模型Controller是第二步.PetShop中有两个Controller
一:AccountController 这里实现了一个帐户的控制(创建,登陆,登出,更新信息)
二:CartController 这里实现了购物流程(储存购物车,设置购物信息,生成订单)
(要注意的是,购物车的设计是Modal的范畴,储存购物车是Controller的范畴)而 View 的职能就是提供界面,显示Modal的信息,根据用户的操作来调用Controller我把BLL和DAL移去是有几个原因的:
一:不这样做一天搞不定.
二:提供一个不用三层来做这个网站的例子.试想想,如果让你做一个这样的网站,你会用三层吗?
换做是我就不会了.我会想一种最快实现全部功能的方案来完成它.
这样会降低项目的风险.
等第一个非三层的版本做好了,再看项目的时间是否足够,才考虑改成三层.
(把一个项目改成三层是很快的..可能也就是几天的事情)