Another important function of the SmartWeb platform is a special Javascript library designated for the web applications' development on D2000. An application programmer can use this library or its parts while implementing individual application pages.
The SmartWeb Framework (SWF) library serves mainly for making easier the work of an application programmer, who than does not have to reinvent the wheel in the development process. The way of using the SmartWeb Framework library reflects the recommended way of developing web applications in the Ipesoft company. This library is completely optional for the development of web applications. Thus a programmer can implement an application without using it. SWF implements basic functions which every web application uses, first of all:
Communication with D2000 is implemented in a code that realizes a connection to the universal Comet interface of the SmartWeb server. Besides communication with the server, several often-used non-trivial UI components (e.g. table, list box and so on) are implemented in the library. These components are not implemented by the D2000 Team responsible for SmartWeb as a project, but they are components from third-party libraries imported to the application using the Bundle Engine module. The following picture shows individual parts of the web application which uses the SmartWeb Framework.
In the upper part of the picture, there are displayed files created by an application programmer:
template.html
is a template of an HTML file which is sent to a browser for every web application page. When requesting particular page of a browser, the SmartWeb Server completes this template by adding a link to a file with a code of the page itself. For example, when requesting the page page.html
, also the file page.js
shows up which contains a code of this page. component.js
) is to prevent code redundancy.In the lower part of the picture, there are displayed following parts of the SmartWeb Framework which the application can use:
Table.js
, DatePicker.js
) programmed for the React framework (the reason for choosing this library will be explained later). Behind every UI component, there is a particular open-source library used which in reality implements the given component. This means that every UI component is only so-called wrapper above the third party library. This wrapper publishes the library's API, or else extends or repairs its behaviour and enables trouble-free usage of components in the React JS framework. D2Api
implements communication with D2000 via the universal Comet interface of the SmartWeb server. This class is independent of the used UI framework and it is possible to use it individually. Except for D2Api, an application programmer can make D2 API and React framework accessible by a concept of a data container (in our case, it is the DataContainer
class). The UI components of the SmartWeb Framework are built on the React JS library from the Facebook company. The reasons for the use of the React JS framework for creating web applications are the following:
27% of respondents have heard of it and they want to learn it.
Since it is widely used, there are many available components, detailed documentation, and descriptions of problem-solving.
There is a low threshold for learning considering the framework possibilities - it is possible to mentally comprehend the concept and API by reading one article.
There is a possibility to declare the design of the application site similarly to HTML in 99% - in the JSX format usable directly in the Javascript code.