[英]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.