简体   繁体   English

我是否应该在WCF(namedPipes)上使用DTO?

[英]Should I use DTO over WCF (namedPipes) or not?

I mean If I was using WCF over http I wouldn't hesitate. 我的意思是,如果我通过HTTP使用WCF,我会毫不犹豫的。

My ORM is LLBLGen Pro which provides me with some pretty nice entity collections features, like tracking changes and other. 我的ORM是LLBLGen Pro,它为我提供了一些非常不错的实体集合功能,例如跟踪更改等。 If I would go the DTO path I would lost this functionality. 如果我走DTO路径,我将失去此功能。 For now there is on the client side a Web app, which does not need any tracking changes funcionality, but maybe some day there will be a silverlight app on the client side. 目前,客户端上有一个Web应用程序,它不需要任何跟踪更改功能,但是也许有一天,客户端上将有一个Silverlight应用程序。

What do you guys think on this ? 你们对此有何看法?

Even when your transport binding is named pipes, WCF will still serialize and deserialize the messages. 即使将您的传输绑定命名为管道,WCF仍将对消息进行序列化和反序列化。 This means that your objects will be copied going back and forth. 这意味着您的对象将被来回复制

Even if you share the type between client and service (not generally recommended) you will still have copies going back and forth. 即使您在客户端和服务之间共享类型(通常不建议这样做),您仍然会来回复制副本。 Essentially, even without explict DTO types, your objects will still be treated as implicit DTOs. 本质上,即使没有显式DTO类型,您的对象仍将被视为隐式DTO。

Oh, and it will only work if they are already DataContracts or IXmlSerializable. 哦,并且只有在它们已经是DataContracts或IXmlSerializable的情况下才起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM