Separation of logic, model and view

Brief

The three elements should not mix. Remember that a user can be:

  • a normal person that uses the GUI
  • a third party application that uses an integration API

So putting business logic only in the GUI will get you int trouble because the system will behave differently for a normal person and a third party application. This can lead to unpredictable results.

A plugin developer is a special type of user. By default he should operate in the same constrains of the previous user types. But, he should have the ability to omit or override them in a explicit manner.

This is a generally accepted MVC architectural pattern. As our system is CRUD orientated the MVC pattern looks a little different in qcadoo:

MVCqcadoo
ModelModel XML Definitions
ViewView XML Definitions, View hooks
ControllerModel hooks, Business methods

Validation

Generally it should be done on the server in model hooks. It can never be done only in GUI.  View hooks aren't sufficient, because they will never run for an third party application which uses an integration API. Validation in the GUI layer can be only implemented to supplement the server side validation with a better user  interaction.