==================================================

Softerra PHP developer's library
Copyright (c) Softerra LLC 2000, 2001

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Contacts:
http://www.softerra.com
mailto:contacts@softerra.com

==================================================

Concept Description

The library is intended to assist in developing database-oriented web solutions.

Here are the reasons why we decided to create our own library. There are a great number of other libraries capable of serving similar purposes. But usually there is only one of a solution's aspects that such a library may contain, and besides, due to their large size using such libraries becomes quite a time-consuming experience. That is why we chose to create a library that would merge all the key elements necessary for fast web middleware development.

Generally, a database-oriented application works the following way:

1. Gets users's request
2. Extracts data from DB
3. Processes data (if needed)
4. Displays results

These are the main tasks faced by a developer who is in process of creating such solutions:

1. Working directly with DB (insert/delete/select/search data)
2. Data processing
3. Creation of DB user interface - display of data contained therein, etc.

The library creation was based on the following application design and development ideology:

1. All work with DB is done via a specialized class
2. Code division into data reception/data processing code and user interface code.

To realize this approach, we suggest you structure the application files as follows:

- main file (URL) - reception/processing of user's request, invocation of reception/processing functions and handover of control to a result displaying file

- file to work with DB - a derived class file that works with selected DB tables as well processes results

- results (page content) display file - a file containing HTML and results display function invocations

It is presumed that when coding starts, the DB structure as well as the key transformations of data in the tables will already have been predesigned.

The main classes used here are sqlStorage  softerraGrid. The library also includes other classes, but they would rather be considered additional and will be described further.

We recommend you start your work from creating DB interaction classes since the interface is going to undergo changes, while the basic data interlinks will be affected only slightly.


This way additional classes are created (inherited from sqlStorage) to further incapsulate all the work with the DB.

The next step is a user interface creation. This is a quite extensive task, which includes a wide range of subtasks. Now we just are going to look at the display of DB tables (request results).
The approach is the same here - via additional classes (inherited from softerraGrid), which will display the request results.

One more issue worth mentioning is variable value storage (e.g. application settings). The classic option is the use of files, i.e. the creation of a configuration file, containing the list of parameters and their values.

Also there is another approach, which is implemented in Windows registry - a centraliized storage for the applications' configuration information. We too have decided to implement a similar scheme in our library.

The idea to create a registry using MySQL with the web interface for it came to us after a sleepless night spent in unsuccessful attempts to tune up a web application with Telnet and FTP refusing to function and HTTP working perfectly well.

A DB is a convenient location for different application parameter storage. A registry gives an opportunity to dynamically modify values and to create new parameters (e.g. a site's background color).

There is also a set of additional functions existing inside the library. Please see details in the Description file.


The package includes files with examples describing the above approach to application development. See the Examples catalogue and the library description (in the Description file)

