title: In MVP, should the View (aka the page) know anything about the Model?
body: <p>I'm really looking more for validation here of my understanding of MVP before I approach the project lead about refactoring major pieces of our application...</p>
  
  <p>We presently have an expanded MVP pattern where we have the following projects:</p>
  
  <ul>
  <li>Entity (Defines POCOs)</li>
  <li>Model (Defines data layer configurations (EF code first - not that it matters here))</li>
  <li>Task (all business logic in a well ordered grouping)</li>
  <li>Presenter (page (or page type) specific, calls tasks, defines and works with all View interfaces)</li>
  <li>View (in the form of different websites (internal, external))</li>
  </ul>
  
  <p>Currently in the View layer I frequently see code that works directly with the Entities, so an ASPX page (could be php, whatever) which has to display a list of entries does so like this:</p>
  
  
  
  <pre class="lang-cs prettyprint-override"><code>public interface IEntityList 
  {
      ICollection&lt;Entity&gt; MyEntities {get;set;}
      event EventHandler OnReportRunning;
  }
  
  public class EntityList : IEntityList
  {
      public ICollection&lt;Entity&gt; MyEntities {get;set;}
  
      private void RenderEntities()
      {
          OnReportRunning(this, null);
          if (MyEntities != null)
          {
              ArrayList entityList= new ArrayList();
              foreach (var entity in Myentities.OrderBy(e=&gt;e.Field))
              {
                  var formatedEntity = new {FullName = String.Format("{0}, {1}", 
                      entity.LastName, entity.FirstName), UserEmail = entity.Email};
                  entityList.Add(formatedEntity);
              }
              ddlEntities.DataSource = entityList;
              ddlEntities.DataBind();
          }
      }    
  }
  </code></pre>
  
  <p>I'm of the opinion that this violates the intent of the presenter layer.  I think the view should expose the <code>DropDownList</code> (ddlEntities) or whatever other controls it has, and the presenter should be the point at which ALL knowledge of the Entity layer stops.</p>
  
  <p>And thus my question - SHOULD the View (V) layer of an MVP (perhaps it should be MPV) architecture have <em>any</em> knowledge of the model (M)?  Or am I right in thinking that the only work the View layer should do is direct reactions to events from the controls, and that all real presentation work (binding, formatting involving entities, etc) should be done in the presenter layer, and that the Presenter layer is SUPPOSED to be strongly aware of the actual View layer (IIS vs. Apache vs Mobile etc)?</p>