Page 195 - DCAP312_WEB_TECHNOLOGIES_II
P. 195
Unit 9: The Database Model
Database Notes
The parser may need to establish a connection to the database to get some information about
the sub forms or sibling forms and use them to generate the code.
Validation
In addition to the user interface code, some auxiliary-codes maybe needed to control/validate
the input data like by injecting javascript control codes into the HTML forms.
Web Services
If a form requires to be connected to another distributed system, then web services is the access
method to such system.
In this way, the form will be displayed and is ready for the next stage.
Processing and Storing Data
The user fills the displayed form and returns it to the system. Figure 9.12 shows the steps clearly
(it assumed the form is an HTML one).
After filling the form by the user, the data will be delivered to parser engine box. One of the
other responsibilities of this box is converting user's data to the proper format that would be
tangible by the system (it has different responsibilities in “designing form” and “displaying
form” phases). It should recognize the relations between sent data and form's fields by referring
to the form’s definition document (in XForms format). This is the first step in importing user's
data to system as a structured one. The next step, which is so important, is data validation. In
“displaying form” process, the validation was done in partial mode but the main activity would
be done after receiving user's data. In this step, user's data should be validated against the form's
logic. In other words the declarative statements that would be supplied in form's logic definition
would be checked against the user's data to verify if they are consistent with them or not. But as
we mentioned earlier, it may be impossible to validate the user's data at the same place where
we display the form to the user. Then it is required to connect to the other part of same system
(or even other systems) to verify correctness of user's data. So as you see in the Figure 9.12, the
validation box may connect to database or use some web services (to connect to other systems
in distributed solutions) to see if the user's data are consistent with other data or not. Note that
we can connect to other systems with different solutions like using RPC (Remote Procedure
Call), CORBA (Common Object Request Broker Architecture). DCOM (Distributed COM) and
so on that are not mentioned in this diagram.
Here we have a consistency problem between distributed databases that should be resolved by
the DBAs (Database Administrators). After user's data is verified and relations between data
and form's components are found, the related objects would be created from the classifiers that
were made in “designing form” phase. In other words, the user's data would be stored in some
objects (in OO concepts). Therefore the user's data are capable to circulate through the system
easily and being processed wherever is needed because its format is recognizable for the program
generator system. Briefly, the objects are the real instances of form's data in the format of the
classes that present the form's schema.
Finally these generated objects should be stored in database. This process would be done by
“Data Access Methods” part. This part receives the user's data in object format and then stores
them in database as output result. This part is responsible for mapping these received objects to
such database objects that were created in “design form” phase and store received objects data
into these database objects. Note that the reason for this mapping in current phase is because of
input objects of this box are OO objects whereas the equivalent objects in database are Database
LOVELY PROFESSIONAL UNIVERSITY 189