Formlets are a way to build composable HTML forms that are type-safe, handle errors, are abstract, and easy to combine into larger forms. The key feature of formlets is that they are composable, like integers that can be added together or enumerables that can be selected, filtered and ordered. This allows text boxes, text areas, dropdowns and other form elements to be combined to create complex nested composite forms through binding operations. Demo code shows how common form validation and error handling tasks can be abstracted using formlets.
2. FORMS
Forms are used to accept input from the user
Forms benefit from structure and predictability
Forms should provide feedback to the user on the data quality (validation)
Once sufficient quality is reached the user submits the data
Some applications may have 100+ different forms
18. FORMLETS
We need some kind of flexible way to bind two Formlets into a new Formlet
As the result of the binding operation is a Formlet the result can be bound as well
This gives endless composability
Like integers are composable: 1 + 2 + 3 + 4
Like IEnumerables are composable: l.Select (...).Where (...).OrderBy ()
Our Formlets are composable: TextBox + TextBox + TextBox + TextBox