Third party Component Libraries
There are few applications which may not rely on 3rd-party component libraries. 3rd-party libraries help to create a feature-rich application with expanded functionality. In some cases, using a 3rd-party library is mandatory. For instance, a database engine may need a particular set of components for connecting and making queries. Reporting is another area where 3rd-party tools come to mind. When it comes to uniGUI applications, 3rd-party tool compatibility becomes an important issue. As described in previous sections, the stability of a web application depends on all the elements of the application. A buggy, poorly developed, or incompatible 3rd-party library can lead to server instability.
There are some important points to take into consideration when choosing a 3rd-party library for a uniGUI application:
Compatibility
uniGUI servers run in a heavily multithreaded environment. Any tool used with uniGUI must be thread-safe — several instances of the component must be able to run in several threads in parallel.
Components that rely on global variables are likely to fail in a web application. Each component instance must maintain its own private data or protect shared data appropriately.
Components that rely on embedded VCL controls are likely to affect server stability. VCL controls are not thread-safe (see the VCL documentation).
Some 3rd-party tools rely on window handles (HWND) and message loops to function. uniGUI does not have a main thread and does not implement a message loop in all deployment modes:
Standalone Server: borrows a main thread from Delphi's VCL and creates a minimized VCL Form; Application.Run() is called, so a message loop exists. Some incompatible components may appear to work in this mode.
ISAPI module (and Windows Service): no VCL form is created and Application.Run() is not called, so there is no message loop. Any component that relies on sending messages (e.g., SendMessage()) may fail or behave differently.
Example: TRichEdit is a VCL control (a Memo with styled text) that internally uses SendMessage() to communicate with its Handle (HWND). Some reporting tools use TRichEdit to generate styled text blocks. A report using TRichEdit may render correctly in Standalone mode but render nothing when the same application runs as a Windows Service or ISAPI module because of the missing message loop.
Some 3rd-party components must be explicitly configured for threaded environments. Check the vendor manual for threading instructions.
Do not use components that depend on global variables, rely on VCL controls without thread-safety guarantees, or require a Windows message loop unless the vendor explicitly supports uniGUI deployment modes (Standalone, ISAPI, Windows Service).
Stability
Any 3rd-party component that has stability issues will affect the stability of the uniGUI application.
Component libraries should be free of critical bugs and tested for memory leaks.
Vendors must ensure their components can be used in a multi-threaded environment without causing crashes or resource leaks.
Scalability
3rd-party components used in uniGUI must be scalable: there should be no arbitrary upper limit on the number of simultaneous instances that may co-exist, except limits imposed by system resources.
If a component has built-in limits, the developer must be aware of them and design the application accordingly.
Related links
Developer's Guide > Application Design Considerations: https://unigui.com/doc/online_help/application-design-considerati.htm
Original page reference: https://unigui.com/doc/online_help/index.html?third-party-component-librarie.htm