Designing a corporate web application, like any other application, should begin with defining the initial goals and the area of tasks to be solved. Create a register of stakeholders.
The next step is to collect the requirements for the application that needs to be developed. Refine the goals and scope of tasks and build a hierarchical structure of work.
Consider separately the task of building a hierarchical structure of work. Each web application can be represented as follows:
')

In other words, each web application sends http requests to the web server to get useful data. A program running on a web server uses one model or another to store data. In the modern world, databases, SQL or NoSQL are most commonly used.
Formally, each web application can be divided into 3 mutually independent parts.
- A module that is executed by a web browser. This application can be written in any language that supports the browser. The most commonly used language is JavaScript, as it is the most supported and has great library support. This is very important, as it allows you to significantly save project budgets.
- A module that is executed on the server side under the control of a web server. This application can be written in any language, the interpretation of which is supported by your chosen web-server. Lately, often, the Java language is chosen as the programming language. This language also has strong library support.
- Database. In this area there is also a fairly wide selection. There are industrial databases, such as Oracle, DB2, PostgreSQL. There are lightweight databases like MySQL. The database is selected based on the goals and areas of tasks.
Possible reference models for designing web applications.When building a web application architecture, it is necessary to minimize the dependence between structural units. In general, an application consists of three structural units.

- A module that runs under the browser.
- A module that runs under a web server.
- Database.
These structural units generate two kinds of bonds.
- The connection between the browser and the server part.
- The connection between the server side and the database.
To achieve the goal of maximum independence between structural units, it is necessary that each structural unit operated only with the necessary data set. Consider in more detail.
A browser is an application software for viewing web pages.
HTML is the standard markup language for documents. Most modern web browsers can interpret HTML.
A web server is software that is able to receive HTTP requests from clients, process them and send a response in accordance with the protocol standard.
A database is an aggregate of independent materials presented in an objective form, systematized in such a way that these materials can be found and processed using a computer. (Wiki)
Minimize dependenciesTo minimize dependencies between the Browser and the Web server, it is necessary that the HTML markup language be used only in the browser, and the Web server provides an interface for retrieving the necessary data for the page.
To solve this problem it is necessary:
- Determine the goals and scope of tasks to be solved within the framework of the created interface.
- Define the server-side API.
- Select the protocol of interaction between the server and the client part. Creating a protocol is most conveniently chosen based on XML, since most modern browsers have built-in support for this language.
- Write a document that will set out the protocol.
Our chart can be converted to the following form:

Next, the "Browser" is converted into UML state diagrams. On these diagrams will be reflected in which case a particular method is called.
This model is achievable in two ways.- The program executed by the "Browser" is written in JavaScript and communicates with the Web Server via AJAX, receiving answers in accordance with a specific protocol.
- The “browser” interprets only HTML code, and the transformations occur via XSLT transformations on the side of the Web Server.
In each of these cases, the separation of the program part of the Web Server and the "Browser" is achieved. That is, using this model, it is possible to make changes to the structural unit for the “Browser” and not cause indirect changes in the server part. This is very important because it leads to a reduction in the cost of processing change requests. This is due to the fact that changes in one structural unit do not go beyond it.
Web Server and Database InteractionThe interaction of the database and the web server can be organized on the basis of two fundamentally different scenarios:
- Business logic is in the database.
- Business logic is in the code of the web server.
In the first case, the database stores the data and provides the data access interface:
- Data sampling - it is solved through representations.
- Data modification - is solved through stored procedures.
A web server program is a driver for accessing business logic. That is, it simply associates the Browser with the business logic that is implemented in the database.
In the second case, the database stores the data, and provides direct access to the data. Business logic is implemented in the web server code. In this case, the database provides transactions for atomic operations.
To minimize the dependencies between the Web Server and the Database, it is necessary that the business logic be defined in only one place. Ie either in the Web Server code, or in the Database. This is very important because it leads to a reduction in the cost of processing change requests. This is due to the fact that changes in one structural unit do not go beyond it.
Hierarchical structure of workBased on the above material, the hierarchical structure of the work will take the following form:
- Module for "Browser".
- Module for Web Server.
- Module for the database.
- The exchange protocol between the browser module and the web server.
- Interface of interaction between the “Browser” module and the Web-Server.
- Interface for interaction between the Web Server and the Database.