.NET Pet Shop按照三层的分层模型来部署整个系统。.NET Pet Shop分为数据展示层,中间层,数据层。这三层被清晰的分割为分布式应用的三个方面。其中数据展示层主要是完成界面和与最终用户交互的功能,在应用程序里面是一些aspx的页面和代码;中间层用于封装商业逻辑和规则,在应用程序里面被封装为.NET组件;数据访问通过中间层中的数据访问组件与SQL Server Provider交互,所有的数据获取依靠存储过程来进行,而不是通过SQL语句。 具体示例请看msdn先!~
A Microsoft MVP said: The reason I recommend against PetShop is not so much any technical reasons but rather the history of the application. As you are probably aware this application was used in some "performance wars" between .NEt and other (java) platforms. As a result there are some implementation choices in all of the versions that play more to the "my bench can beat your bench" rather than good design. Even better, the Petshop database is basically as crappy as it can get, from a db design point of view. There was a white-paper once by one competitor who made a petshop-like (a transposition of petshop) sample for his O/R mapper. He explained over pages with good argument how the Petshop tabase looked like it was done by someone who had no clue bout how to make a database. We talk about not normalized data an tables that re totally out of context, if I remember correctly. Now, you have to understnd, though, that this is so because it was so in Petshop from the java times. petshop的一个改写 http://www.dotnetguru.org/articles/PetShop/PetShopDNG/us/PetShopDNG.htm
你要先了解三层基础,然后再了解与其相关的层次,
最主要的代码是必须要看的,然后再网上找找相关文档、光听别人讲是听不明白的。
具体示例请看msdn先!~
The reason I recommend against PetShop is not so much any technical reasons but rather the history of the application. As you are probably aware this application was used in some "performance wars" between .NEt and other (java) platforms. As a result there are some implementation choices in all of the versions that play more to the "my bench can beat your bench" rather than good design.
Even better, the Petshop database is basically as crappy as it can get, from a db design point of view. There was a white-paper once by one competitor who made a petshop-like (a transposition of petshop) sample for his O/R mapper. He explained over pages with good argument how the Petshop tabase looked like it was done by someone who had no clue bout how to make a database. We talk about not normalized data an tables that re totally out of context, if I remember correctly. Now, you have to understnd, though, that this is so because it was so in Petshop from the java times. petshop的一个改写
http://www.dotnetguru.org/articles/PetShop/PetShopDNG/us/PetShopDNG.htm
前台表现层.
中间逻辑层.
数据层.其实这样的方式,主要的问题是把代码尽量的精练化.
所以,我要注意的问题,就是存储过程参数的灵活分配了.象cnblog,那个开源的.net论坛,等开源的都是这样的模式.
底层的代码,图简单就和cnblog一样用sqlhelper
要么就选一个模型.比如mvp,cmp,那个开源的.net论坛的模型也是大同小意的, 不知道叫什么名字.