Is a circular link between business objects (in a hierarchy) shared?

The Linq-to-Sql classes provide parents with a link to a child collection, as well as a child link to a parent (single or collection). This allows you to "drill" in both directions , and it seems quite convenient.

Is it a design that is also suitable for using manually created business objects (POCOs or others)? When; What were the pros / cons or specific situations when this would be recommended?


EDIT1:

I think mainly about logical behavior; which means not user interaction, but like programs related to financial transactions, gaming software, etc. What to do if you are dealing with a child object and then need some parameter of its parent. This seems pretty convenient, but maybe these are other parts of my encoding methods that are a problem and make me feel like I need it.

+3
source share
4 answers

, . - . , : . , .

RDMS... , , , .

0

, , , 2 .

- , .

, , .

- :

class Company
{
  Person ContactPerson {get;set;}
}

class Person 
{
  Company Company {get;set;}
}

22 ( ) , .

.

+2

- , , . , , , . , , .

, . . , , , .

+1

. , :

  • - Leppie. FK . , - FK, .
  • . , , ( ). , , , - (). (PreserveObjectReferences WCF 3.5+ (IsReference = true)).

, "" /. ( , Linq2Sql)

0
source

Source: https://habr.com/ru/post/1788125/


All Articles