English 中文(简体)
实体框架POCO with WCF 软件设计问题
原标题:Entity Framework POCO with WCF software design question

我将运用实体框架和世界合作框架。 正如我所看到的那样,所建议的做法是利用有实体框架的POCO,并利用POCO课程作为数据查询。 事实上,如果我不错的话,那么就使用了POCO和 Attributes。

但 要求我使用实体框架、POCO和WCF数据合同的适当类别。 并且使用POCO和数据合同之间的地图。 同FooContract, 具有相同特性。

我是第一种做法,但我想知道,第二种办法(妥善的班级办法)是否为应用提供了灵活性,还是只是浪费努力。

请大家分享您关于为POCO和数据查询、制作和整理而使用适当课程的想法和经验。

最佳回答

为贵组织开设单独的班级和您的合同将使你能够创建面向信息的服务,而不是为太平洋共同体提供模式服务。

有了以电为导向的服务,你的服务就能够更加灵活,能够做更多的工作,并且与每个服务对象的联系更少。

信息服务也更加符合服务型建筑的精神。 可在Wikipedia上阅读更多信息。

我还建议,如果你对良好服务设计的原则感兴趣的话,请上

问题回答

在持久性层面和合同一级有不同的数据类别,使你具有最灵活度。 例如,你可能不想暴露你在合同上的所有持久性领域,或想暴露出与合同不同的数据等级等。 它还允许相互独立改变。

首先,在两个层次上使用不同班级似乎是重复的,但从长远来看,工作并不多(与你所表现出的灵活性相比)。 在需要时,你可能会使用相同的班级,并发展不同的班级,但与这一办法有关的问题是,在短时间内,你的服务会紧跟数据班,而不是信息/数据,即服务应当与服务打交道。





相关问题
Entity Framework with MySQL connector in c#

I have been trying to get the Entity Framework to work in my web application using MySQL. It works fine on my local pc, but doesn t work when I put it on the server. Since the server is a shared ...

How Do I Create And Update A Many To Many Relationship With EF

I am using the Entity Framework with SQL Server. I have a many to many relationship between 2 tables. I have created a join table with just the primary key fields of the 2 tables. In the designer, the ...

Entity Framework with File-Based Database

I am in the process of developing a desktop application that needs a database. The application is currently targeted to SQL Express 2005 and works wonderfully. However, I m not crazy about having ...

Linq to enties, insert foreign keys

I am using the ADO entity framework for the first time and am not sure of the best way of inserting db recored that contain foreign keys. this is the code that i am using, I would appreciate any ...

Entity Framework - Many to many question

I have a table called ASB and a table called PeopleInvolved. There is a junction table called PeopleInvolved_ASB which simply contains an ASBID and a PeopleInvolvedID column. The columns act as a ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

ADO.NET Entity Data Model are not precise enough

I run this code: var cos = from k in _db.klienci_do_trasy where k.klient_id == 5 select k; but the query send to database is: SELECT * FROM `klienci_do_trasy` LIMIT 0, 30 why is it for, there ...

热门标签