使用 TDD 和 PI 的 WCF、Unity、EntLib5、Linq-to-SQL 示例
我正在尝试开发一个 .NET 3.5 服务应用程序,该应用程序使用:
- WCF 用于服务层
- 业务对象层用于封装我们的业务逻辑(并隔离服务和数据访问层)
- Linq-to-SQL 用于数据访问技术
- Unity 用于依赖注入
- Enterprise Library 5 具有以下内容:
- 验证应用程序块
- 异常处理应用程序块
- 记录应用程序块
我们还希望遵循 TDD 并希望持久性无知 (PI),因为当我们稍后升级到 .NET 4.0 时,我们可能会将数据访问技术更改为 NHibernate 或 EF。今年,我们希望通过将其仅隔离到数据访问层来最大程度地减少此类更改的影响。
我已经使用该应用程序一个多星期了,并且已经完成了相当多的工作。我还没有成功实现 EHAB 或 LAB,验证仅部分实现,并且 PI 不是基于 POCO 的,因为我们需要支持设计器(而不是使用 XML 映射)。我们正在使用带有 PI 接口的存储库模式。
谁能给我指出一些结合使用这些技术的高质量(现实世界)示例解决方案?这可能是解决我的问题和疑虑的最佳方式,因为到目前为止我引用的文章只涉及我的解决方案的一两个方面,并且当我将所有这些连接在一起时,事情的工作方式与它们所描述的并不完全相同。
I am trying to develop a .NET 3.5 service application that uses:
- WCF for the service layer
- Business object layer to encapsulate our business logic (and isolate the service and data access layers)
- Linq-to-SQL for the data access technology
- Unity for dependency injection
- Enterprise Library 5 with the following:
- Validation Application Block
- Exception Handling Application Block
- Logging Application Block
We are also looking to follow TDD and want persistence ignorance (PI) as we may be changing data access technologies to either NHibernate or EF when we upgrade to .NET 4.0 later in the year and we want to minimize the impact such a change will have by isolating it to just the data access layer.
I have been working with the application for a little over a week now and have quite a bit of it working. I have yet to get the EHAB or LAB implemented successfully, validation is only partly implemented and PI is non-POCO based because we are required to support the designer (as opposed to using XML mapping). We are using the repository pattern with interfaces for PI.
Can anyone point me to some quality (real-world) example solutions using these technologies together? That's probably the best way to address my questions and concerns because the articles I've referenced thus far only touch on one or two aspects of my solution and things aren't working exactly the same as they describe when I wire all of this together.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过查看 p&p 动手实验室:
下载示例解决方案和说明
这些非常容易完成,为您提供指导和使用模式。
Have you tried looking through p&p hands-on labs:
download sample solutions and instructions
These are pretty easy to work through, giving you guidance and usage patterns.