Recently I’ve been working on an application that provided a generic framework for entering data into a form. We chose the framework approach for two reasons:
- It was faster to build new forms when we only had to specify the fields and validation rules. All of the control logic and data persistence was already in the framework.
- Form quality improved because the framework made it easier to validate fields which encouraged developers to validate input properly.
While the framework was great for simple forms it just didn’t work when complex business logic needed to be applied. Instead of throwing away the framework we used Javascript hooks that were called at various points in the process to allow the form to customize the business logic.
