.netTiers模板到2006年就诞生了, 到今天最后一次更新是12/17/2013, 支持.NET 4.5 and Visual Studio 2012 and 2013. netTiers是基于微软企业库的模板项目.
在今天各种PC端应用软件横行天下, 使用代码生成工具来提高开发效率是经常的事儿. netTiers构架设计是这样的:
运行codesmith时,是这样的:
上图可以配置数据库与表,是否生成UnitTest,WebService, 数据验证的类库, CRUD选项 ,基于微软企业库5.0, 目前支持SQL SERVER与Oracle
生成完后,会生成report.html, 最后生成VS2013的解决方案与项目:
上面有Service Layer, WebService, UnitTest, WinForm, 还有老式WebSite, 可惜不是MVC的前端. 但实际上稍加调整就可以了.
对于开发过N-Layer项目的您, 对这些不难理解.
其中Data Layer的基类UML:
项目中涉及的相关模式参考
ServiceLayer
http://martinfowler.com/eaaCatalog/serviceLayer.htmlProcessors
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, Decoratorhttp://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, TableModulehttp://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
更多介绍参考, 官方网站, 源代码. 由于篇幅有限,今天先介绍到这儿.
您可能感兴趣的文章:
如有想了解更多软件开发资讯,请关注我的微信订阅号:
作者:Petter Liu
出处:http://www.cnblogs.com/wintersun/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
该文章也同时发布在我的独立博客中-Petter Liu Blog。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· 【.NET】调用本地 Deepseek 模型
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)
2012-09-14 VisualStudio2012轻松把JSON数据转换到POCO的代码
2007-09-14 Repeater绑定时实现类似DataList两列的效果