title: Where to place DTO <==> Entity translator in WCF service?
body: <p>I have the following design :
  <a href="http://s15.postimg.org/3zha8rzqh/Design_Idea.png" rel="nofollow noreferrer">My Design</a>
  <a href="http://s15.postimg.org/3zha8rzqh/Design_Idea.png" rel="nofollow noreferrer">My Design http://s15.postimg.org/3zha8rzqh/Design_Idea.png</a></p>
  
  <p>I will have a class called 'ProductDTO' in my <strong>service layer</strong> (the left service).</p>
  
  <p>When the 'Update Product ( ProductDTO )' operation contract is called - it should call the 'Update Product' function in the <strong>Business Logic Layer</strong>.</p>
  
  <p>In the database (the <strong>'Data Access Layer'</strong>) there is an entity called 'Product', and because I use LINQ-To-Entities I will also have a class there called 'Product'.</p>
  
  <p>My question is - where do I translate from 'ProductDTO' to 'Product' ?</p>
  
  <p>Should I have a 'Translate_ProductDTO_To_Product' function in the <strong>service layer</strong> ?
  It seems the most logic answer, because that is the only layer that knows what 'ProductDTO' is.</p>
  
  <p>But this means that the <strong>service layer</strong> will also have to know what 'Product' is, and thus will have to reference the <strong>data access layer</strong> assemblies.</p>
  
  <p>Is this correct ?</p>
  
  <p>I thought that the <strong>service layer</strong> should only reference the <strong>business logic layer</strong>, and that the <strong>business logic layer</strong> should only reference the <strong>data access layer</strong>, and that the service layer should know nothing about the DAL.</p>