posts - 930,  comments - 588,  views - 402万
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

          .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   PetterLiu  阅读(4470)  评论(2编辑  收藏  举报
编辑推荐:
· [.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两列的效果
点击右上角即可分享
微信分享提示