title: DAL Layer : EF 4.0 or Normal Data access layer with Stored Procedure
body: <p>Application :</p>
  
  <p>I am working on one mid-large size application which will be used as a product, we need to decide on our DAL layer. Application UI is in Silverlight and DAL layer is going to be behind service layer. We are also moving ahead with domain model, so our DB tables and domain classes are not having same structure. So patterns like Data Mapper and Repository will definitely come into picture.</p>
  
  <p>I need to design DAL Layer considering below mentioned factors in priority manner</p>
  
  <ol>
  <li>Speed of Development with above average performance</li>
  <li>Maintenance</li>
  <li>Future support and stability of the technology</li>
  <li>Performance</li>
  </ol>
  
  <p><strong>Limitation :</strong></p>
  
  <p>1) As we need to strictly go ahead with microsoft, we can not use NHibernate or any other ORM except EF 4.0</p>
  
  <p>2) We can use any code generation tool (Should be Open source or very cheap) but it should only generate code in .Net, so there would not be any licensing issue on per copy basis.</p>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li>I read so many articles about EF 4.0, on outset it looks like that it is still lacking in features from NHibernate but it is considerably better then EF 1.0</li>
  </ol>
  
  <p>So, Do you people feel that we should go ahead with EF 4.0 or we should stick to ADO .Net and use any code geneartion tool like code smith or any other you feel best</p>
  
  <ol start="2">
  <li><p>Also i need to answer questions like what time it will take to port application from EF 4.0 to ADO .Net if in future we stuck up with EF 4.0 for some features or we are having serious performance issue.</p></li>
  <li><p>In reverse case if we go ahead and choose ADO .Net then what time it will take to swith to EF 4.0</p></li>
  </ol>
  
  <p>Lastly..as i was going through the article i found the code only approach (with POCO classes) seems to be best suited for our requirement as switching is really easy from one technology to other.</p>
  
  <p>Please share your thoughts on the same and please guide on the above questions </p>