.netTiers模板到2006年就诞生了, 到今天最后一次更新是12/17/2013, 支持.NET 4.5 and Visual Studio 2012 and 2013. netTiers是基于微软企业库的模板项目.
在今天各种PC端应用软件横行天下, 使用代码生成工具来提高开发效率是经常的事儿.  netTiers构架设计是这样的:

design

运行codesmith时,是这样的:

codesmith

上图可以配置数据库与表,是否生成UnitTest,WebService, 数据验证的类库, CRUD选项 ,基于微软企业库5.0, 目前支持SQL SERVER与Oracle

生成完后,会生成report.html,  最后生成VS2013的解决方案与项目:

codesmith2

上面有Service Layer, WebService, UnitTest, WinForm, 还有老式WebSite, 可惜不是MVC的前端. 但实际上稍加调整就可以了.

对于开发过N-Layer项目的您, 对这些不难理解.

其中Data Layer的基类UML:

datauml

 

项目中涉及的相关模式参考

ServiceLayer

http://martinfowler.com/eaaCatalog/serviceLayer.html
Processors
By default is a Pipeline:
http://www.enterpriseintegrationpatterns.com/PipesAndFilters.html
but easily can be used with workflow management in:
http://www.enterpriseintegrationpatterns.com/ProcessManager.html
Each Individual Processor uses a:
Command
http://www.dofactory.com/Patterns/PatternCommand.aspx
Flexible enough to be used within a strategy passed into the ctor to manage different behaviors in complex logic. http://www.dofactory.com/Patterns/PatternStrategy.aspx
DomainModel + ActiveRecord
http://martinfowler.com/eaaCatalog/domainModel.html
http://martinfowler.com/eaaCatalog/activeRecord.html
Edit

Data Access Layer

Singleton, Decorator
http://msdn2.microsoft.com/en-us/library/ms998426.aspx
http://www.dofactory.com/Patterns/PatternDecorator.aspx
Data Transfer Objects:
http://martinfowler.com/eaaCatalog/dataTransferObject.html
Repository Provider:
http://davidhayden.com/blog/dave/archive/2004/05/19/259.aspx
Edit

Entity Layer

Each Entity - Memento, State, DomainModel, TableModule
http://www.dofactory.com/Patterns/PatternMemento.aspx
http://www.dofactory.com/Patterns/PatternState.aspx#_self2
http://martinfowler.com/eaaCatalog/domainModel.html
http://martinfowler.com/eaaCatalog/tableModule.html
Entity Factory
http://www.dofactory.com/Patterns/PatternFactory.aspx
WebService Client - Proxy
http://www.dofactory.com/Patterns/PatternProxy.aspx
Sql Expression - Builder
http://www.dofactory.com/Patterns/PatternBuilder.aspx

更多介绍参考, 官方网站, 源代码.  由于篇幅有限,今天先介绍到这儿.

 

您可能感兴趣的文章:

nettiers系列

Repository Factory介绍

 

如有想了解更多软件开发资讯,请关注我的微信订阅号:

MegadotnetMicroMsg_thumb1_thumb1_thu[2]

 


作者:Petter Liu
出处:http://www.cnblogs.com/wintersun/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
该文章也同时发布在我的独立博客中-Petter Liu Blog

posted on 2014-09-14 15:28  PetterLiu  阅读(4460)  评论(2编辑  收藏  举报