Note that there are some explanatory texts on larger screens.

plurals
  1. POProject Structure for N-Tier Architecture in .Net - Cross Referencing Layers
    primarykey
    data
    text
    <p>I'm implementing an N-Tier architecture in .Net, comprised of an Entity layer, a DAL layer, a Business layer, and a UI layer.</p> <p>The entities, in addition to primitive fields, contain navigation properties. An example of this would be an Invoice entity, which has an InvoiceLines property, which should return all InvoiceLine entities associated with the parent Invoice entity.</p> <p>Owing to the fact that there is business logic which needs to be applied to these InvoiceLines once they have been retrieved from the persistence medium, and not wanting to duplicate code, the InvoiceLines property on the Invoice entity populates itself via a call to a GetInvoiceLinesByInvoiceID method within the business logic, which returns IEnumerable.</p> <p>My problem is this - I cannot separate out the layers into separate projects, since the Entities project depends on the Business project, and the Business project depends on the Entities project, thereby introducing a cross reference. I currently have all 3 layers (Entities, DAL and Business) living in the same project, which works fine, but means I cannot share just the Entities amongst other solutions.</p> <p>I appreciate that by cross-referencing layers in this way I'm violating some principle, but it's extremely convenient to have navigation properties populated on my Entities with business logic applied to them.</p> <p>Can anyone please suggest a better approach, or some way I can do this whilst keeping my layers in separate projects?</p> <p>Cheers</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload