Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Should Entities refer to fields from related tables?
Message
De
28/05/2010 17:06:42
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
28/05/2010 13:34:29
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01466424
Message ID:
01466446
Vues:
39
Hi Frank,

>Hi,
>
>I have a Clients table and a Policies table. A client can have one or many policies. When displaying a single Policy I want to display some of the client details like Name and Number. Should I set Client as a child business object of Policy, or should I include the related fields in the Policy entity?


My personal opinion is that Entity objects should not contain properties from other entities. You can easily once you have the policy entity, just call the client biz obj to get the specific fields for the specific record you are working with and bind those to whatever controls you are displaying in. I would guess they would need to be read only. But if the policy record navigates then you need to also re-query the client table for related values.
Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform