Validating attributes
Object-oriented databases lack one very important thing that relational databases have: consistency. As consistent data handling and relational database support is a very important consideration in GIS software (at least to support a server-side spatial database), we need to implement some restrictions in our data management system. In this example, called ch04_validation
, we will extend our application with typed attributes and validation.
Tip
One possible solution for easy RDBMS support is using the Web SQL Database API. However, this API is deprecated and not supported by any of the Firefox and Microsoft browsers. In supported browsers, it uses an SQLite backend.
Adjusting the styles
As we are using a form for attribute management, we can harness its validating capability as we use typed attributes. For numeric fields, we will use a number input, which does not process strings. In non-Microsoft browsers, numeric fields also prevent us from submitting the form if it detects...