简体   繁体   English

使用DataRelation有什么好处?

[英]What is the advantage of using a DataRelation?

I'd like to know what the advantage of using a DataRelation in .NET is, as opposed to crafting the relationship in the data layer itself? 我想知道与在数据层本身中建立关系相比,在.NET中使用DataRelation有什么好处? Or is this largely a decision by the developer about which tier to place their logic in? 还是在很大程度上由开发人员决定将其逻辑放置在哪一层?

A DataSet (and its various components) basically functions as an in-memory representation of table-based data, and is most useful for allowing a client application to work with data in a disconnected state. DataSet(及其各种组件)基本上起基于表的数据的内存表示形式,并且对于允许客户端应用程序以断开状态使用数据最有用。 Therefore, a DataRelation shouldn't normally function in place of a data relation defined in your database; 因此,DataRelation通常不应代替数据库中定义的数据关系。 rather, it should function as an emulation or representation of that relationship defined elsewhere. 相反,它应该充当其他地方定义的关系的仿真或表示。

Architecting your system so that a data relation is defined only in your client application in the form of a DataRelation would be a bad idea, IMHO. 架构您的系统,以便仅以 DataRelation的形式在客户端应用程序中定义数据关系将是个坏主意,恕我直言。

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

相关问题 使用Interface有什么好处? - What is the advantage of using Interface? 使用Saxon for .net的最大优势是什么? - What is the most advantage using Saxon for .net? 使用DataContractAttribute而不是SerializableAttribute的优势是什么? - What is the advantage of using DataContractAttribute over SerializableAttribute? 使用便携式类库而不是使用“添加为链接”有什么好处? - What is the advantage of using portable class libraries instead of using “Add as Link”? 使用等待顺序调用异步任务的好处是什么? - What Is The Advantage of Sequentially Calling Async Tasks Using Await? 使用二项元组与字典相比有什么优势? - What is the advantage of using a Two Item Tuple versus a Dictionary? 使用异常过滤器有什么好处,我应该什么时候使用它们? - What is the advantage of using Exception filters and when should I use them? C#:与硬编码相比,使用数据绑定控件有什么优势? - c#: what is the advantage to using the databinding control vs hard coding? WCF中WSDualHttpBinding的优点是什么? - What is the advantage of WSDualHttpBinding in WCF? 在这里使用任务有好处吗 - Is there an advantage to using a task here
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM