Skip to content.

Manageability

Sections
Personal tools
You are here: Home » blog » stuff » 5 Rules of Model View Separation

5 Rules of Model View Separation

Excerpt form Terrence Parr's paper "Enforcing Model-View Separation in Template Engines":

  1. A view cannot modify the model either by directly altering model data objects or invoking methods on the model.
  2. A view cannot perform computations upon dependent data values. (To be independent of the model, the view cannot make assumptons about the meaning of the data.
  3. A view cannot compare dependent data values, but can test the properties of data such a presence/absence or length of multi-valued data value.
  4. A view cannot make data type assumptions. Furthermore, a view cannot call methods with arguments.
  5. Data from the model must not contain formatting information.

So, how many rules does your template engine violate (i.e. Entanglement Index)?

Created by admin
Last modified 2004-03-16 07:36 AM

visitors
reading
 
 

Powered by Plone

This site conforms to the following standards: