Web Forms With Erlang
I started a project that I eluded to in my previous entry. I only wrote the specification and started on some code. so it is far from complete. This is what I wrote so far as a "goal" statement:
A mini-framework on top of ErlyWeb to:
1. Generalize a common set of patterns when related to web form development.
2. Siimplify the creation of forms for instant gratification.
This is accomplished by:
1. A general web form behaviour in Erlang, which handles generating new and edit forms as well as deleting and retrieving data for results or details.
2. A specific way of creating multiple amount of forms in a unit.
3. A way to quickly generate forms, which can be played with immediately.
4. An HTML form generator that takes form specificiations an can genereate simple forms as something to start off with before a better design is created.
5. The allowance of the system to easily adapt to new HTML designs and code.
The idea is this: I got a form of something - be it data to fill in from one or more database tables, or email to send, or whatever. The implementation makes a common set of assumptions about what is going to happen to the data.
The assumptions are this:
- This something will be created.
- This something will be edited.
- This something will be deleted.
- This something will be retrieved.
What is being modeled is the common expectations of what will be performed:
- Data needs to be validated
- If validations succeed, we need to know what to do next.
- If the validations fail, we need to know what to do next.
The system will have a sensible set of defaults, making it possible to make a form quickly, with the validations, and the form can immediately be tested (without any database code or what not.) When the form is shown to work, the details can be plugged in. (One idea that came to my head was to have the framework make a temporary table in Mnesia, so the retrieving aspect can be quickly tested.)
My idea is to utilize an Erlang behaviour in this case. With a behaviour, the compiler can check if my specific forms are missing functions, and warn the developer of the missing function.
The result is a framework the mixes a bit of simplicity (sort of what you get with ErlyWeb or Rails instant CRUD generators) as well as being general enough to be actually useful outside of just simple CRUD.
In this process, I have started to rewrite my HTML form builder I mentioned in a prior post. There is a lack of generality in it that I need to fix.
A mini-framework on top of ErlyWeb to:
1. Generalize a common set of patterns when related to web form development.
2. Siimplify the creation of forms for instant gratification.
This is accomplished by:
1. A general web form behaviour in Erlang, which handles generating new and edit forms as well as deleting and retrieving data for results or details.
2. A specific way of creating multiple amount of forms in a unit.
3. A way to quickly generate forms, which can be played with immediately.
4. An HTML form generator that takes form specificiations an can genereate simple forms as something to start off with before a better design is created.
5. The allowance of the system to easily adapt to new HTML designs and code.
The idea is this: I got a form of something - be it data to fill in from one or more database tables, or email to send, or whatever. The implementation makes a common set of assumptions about what is going to happen to the data.
The assumptions are this:
- This something will be created.
- This something will be edited.
- This something will be deleted.
- This something will be retrieved.
What is being modeled is the common expectations of what will be performed:
- Data needs to be validated
- If validations succeed, we need to know what to do next.
- If the validations fail, we need to know what to do next.
The system will have a sensible set of defaults, making it possible to make a form quickly, with the validations, and the form can immediately be tested (without any database code or what not.) When the form is shown to work, the details can be plugged in. (One idea that came to my head was to have the framework make a temporary table in Mnesia, so the retrieving aspect can be quickly tested.)
My idea is to utilize an Erlang behaviour in this case. With a behaviour, the compiler can check if my specific forms are missing functions, and warn the developer of the missing function.
The result is a framework the mixes a bit of simplicity (sort of what you get with ErlyWeb or Rails instant CRUD generators) as well as being general enough to be actually useful outside of just simple CRUD.
In this process, I have started to rewrite my HTML form builder I mentioned in a prior post. There is a lack of generality in it that I need to fix.