Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would actually take the following approach:</p> <p>Have the models (POCOs) for example in a project that is referenced only by your DAL and BLL. That will ensure that you can work with them in the DAL layer and apply the business logic to them in the BLL.</p> <p>For the presentation layer I would create DTOs (Data Transfer Objects) which will be carrying only the data that you need for a specific scenario/entity. The translation between the DTOs and POCO, I would place in the BLL. </p> <p>I can think of the following pros &amp; cons to this approach:</p> <p><strong>1) Pros</strong></p> <p>-- Full separation between presentation and core layers (BLL, DAL). Your DTOs will be independent from the database (POCOs) which means that whatever changes you do to the database, you will only need to change that in the translations layer.</p> <p>-- Stable BLL API -- Validation separation - you can implement validation on the DTOs for the presentation and on the POCOs for the BLL. </p> <p><strong>2) Cons</strong></p> <p>-- Translation rules for each POCO-to-DTO. This will inevitably add some complexity to your code, but I believe that it is a good payoff. -- Performance overhead. The translation and instantiation of DTOs and POCOs will add some overhead to your application. Depending on your requirments and machine capabilities you can decide whether this is a good payoff.</p> <p>I also advise you to take a look at some mapping libraries that allow easy mapping/translation between different types of objects. In my opinion the best one is <a href="http://nuget.org/List/Packages/ThisMember/0.7.0" rel="nofollow">ThisMember</a> both in simplicity and performance.</p> <p>Regards</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.
    1. This table or related slice is empty.
    1. VO
      singulars
      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