Raise your level of abstraction
In order to simplify the concept of what is a model and what we can do in a practical way, I will explain how to use a simple HTML form as a model.
An HTML form can provide us a simple and practical model to generate code from.
Looking to the DOM of a HTML form we can extract two main characteristics:
- Form name;
- Form fields;
Form fields by itself provide us other properties:
- type(text, password,radio, checkbox, textarea, select)
Based upon this features we can abstract that a form looks like a entity and the form fields looks like a properties.
more even if you have more than one form on the HTML file it can be compared to a Database Schema
With those premises in mind, I put inside my web tool the capability of to transform a HTML form into a common model and then generate code from it.
To see this approach working, please go to http://www.zumcoder.com and try to use the transformation tool (main menu->tools->transformation).
Just place your HTML file into the application and set the parameters:
- model to "htmlModel"
- select your templa set
- set the output (mail or zip)
- click the button "next".
Wait for your considerations.
Thanks and regards
Add a Comment