5 Rules of Model View Separation
|
|
Excerpt form Terrence Parr's paper "Enforcing Model-View Separation in Template Engines":
- A view cannot modify the model either by directly altering model data objects or invoking methods on the model.
- 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.
- 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.
- A view cannot make data type assumptions. Furthermore, a view cannot call methods with arguments.
- Data from the model must not contain formatting information.
So, how many rules does your template engine violate (i.e. Entanglement Index)?

