How AdomScript Works
If you haven't read ADOM & AdomScript.js for SPA, you can read it Here.
Working with the ADOM Framework
AdomScript can utilize the unique returns that ADOM Software (Patent No: 10,872,065) provides:
- Data
- Data Structures
- Schema (used in AdomScript Validations)
*below is an example of an Address Record on the database
Developers are used to needing objects for each column of data seen above. While ADOM does have a Class Generator to provide developers with these objects, we wanted to allow for front-end developers to use all of ADOM without the need for objects. Here’s how that was achieved:
ADOM and XML
ADOM is going to return the data (along with metadata/schema) back to the developer as XML/XSD – complete with all the structure that the data has on the database.
*Below is an example of an ADOM return — this is the same Address Record as before
This will give the developer data they can then call upon via Table Name and Column Name. As you can see, the structure will even provide references to other tables, from within the context of the data you (or the user) needs to work with. Each level of the data contains a “Modify Type ID” that the developer can utilize to define CRUD when they send the data back to ADOM for processing.
The Modify Type IDs are as follows:
- 0 - Does Nothing
- 1 - Creates
- 2 - Edits
- 3 - Deletes
And, yes — you can Edit, Create, and Delete multiple records in one transaction with the database.
*Below is an example of the Address Record's metadata
As you can see, we can understand (via the XSD) what the database is expecting. Without a need for objects that are strongly-typed, we can validate form inputs.
The Drag-n-Drop App Creator that is being developed (stay tuned) uses the XSD to suggest to the developer what type of input an element should be.
JSON, JSON, and more JSON
The XML and the XSD are easily converted to JSON.
AdomScript is built to do all of the heavy lifting. Entire forms can be placed on a browser, populated with data, and bound to their datasource via JSON Objects.
The AdomScript developer is not going to be writing HTML to create forms that can load/save data — the AdomScript developer is going to be creating JSON objects that AdomScript will use to create these forms dynamically — no matter which record they are working with.
Here is how AddressLine1 and AddressLine2 are placed on the browser
Here is how the Address Record is linking to another table for a drop-down list
What is left to do is to tell AdomScript which div to display the form in. All of the IDs will match the Column Name of their counter-part on the database. We use a Namespace Approach so AdomScript knows which Table Name to look for when saving.
*Below is an example of the address record becoming a form on the browser