Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Interestingly enough, the question right next to this one in the "active" group of the "architecture"'s tag is <a href="https://stackoverflow.com/questions/8741561/net-n-layer-architecture-what-do-i-do-about-the-model-objects">.NET N-Tier Architecture: What do I do about the Model objects?</a> and it seems to have had a lot more attention than this one, in spite of being very similar.</p> <p>Anyway, not specifically regarding .Net/WCF/WPF, it all depends on the kind of flexibility you are aiming for (or your requirements mandate). To me, there's nothing wrong with what you're doing and is, overall and IMHO, the smartest approach as it frees you from the rigidness of the data store. </p> <p>Remember that if you're allowing external systems to connect to yours (via a web API, for instance), you should absolutely <em>not</em> expose your DAL. Even the BLL should be wrapped in a thin layer so that the you can abstract specific needs of the transport layer (which is what WCF tries to achieve but may not be enough if you have special business logic over a specific transport channel - API keys, etc.).</p> <p>The greatest gain is the ability to customize your DTOs depending on the services being invoked. Just as an example, look at LinkedIn's web APIs. They allow clients to "request" the data that it wants at any given time and build a particular view of the data set, adapted to its needs, decreasing bandwidth usage (for every API service the client does not receive the whole data set, just a particular view that it requests). This is a web example but the design pattern could also apply to fat clients. </p> <p>Regarding performance, there will surely be an impact in converting entities to DTOs to View objects to etc. But check if your system's performance is not bound by other factors first (database, memory, threading, etc.). The DTO option might even be faster, depending on how you build your services, since you might be sending a lot less information through the network. It's probably more important to design your BLL carefully so that you take the entity to DTO to entity conversation into consideration. The same applies to every other layer in your system (services to presentation, etc.). </p>
 

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