我刚被分配到一个ORM映射项目(带有C#代码和SQL Server数据库的以数据为中心的应用程序),其中明确要求使用POCO,并且ORM将从C#对象自动生成数据库 - 所以C#对象模型实际上是数据的王者。
我以前没有听说过POCO,我本能地非常担心自动生成数据库表的想法,因为(a)我的所有经验都让我相信,在以数据为中心的应用程序中,数据模型就是这样的东西。你必须先做对,并且(b)我怀疑自动生成的数据模式在索引,性能等方面是远程优化的。
任何人都可以指导我任何链接(或直接解释)这种方法的优缺点吗? 我试图更好地理解它,但很难找到关于它的很多概念信息。
谢谢
Developing n-layered application with DDD (o better DDDD because we are using WCF) using Microsoft technology (where we have full controll of all component), the best choise seems to be STE vs POCO (this last one force the usage of DTOs). That's right? In your opinion make sense the usage of STE with DTOs where we need them?
Thanks.
最满意答案
你现在可能刚刚完成了你的项目,但我有一个链接给你一个有类似问题的人: 使用STE vs POCO的DDD
I really can recommend Julie Lerman's Programming Entity Framework. She goes in depth about simple poco's, dto's and Self Tracking Entities. Advantages and disadvantages are described. But off course depending a lot on application requirements and personal taste.
So I can't give you an exact answer because the question is to general for that. But reading the book should give you a taste of the possible alternatives and can help you in making these kind of design decisions. I'm working with Self Tracking Entities in combination with a Business Access Layer, Serive Layer, WCF, Win / WPF clients. And expanding it in the future most probably with ASP.NET
更多推荐
发布评论