Application Design Considerations

<< Click to Display Table of Contents >>

Navigation:  Developer's Guide >

Application Design Considerations

There are certain aspects which make a uniGUI Web application different from a desktop application. A desktop application is designed to run as a single instance on the desktop, and it can use all available system resources. Most of the time, this will result in a bad application design, as developers don't see a need to optimize resource usage. With advancements in computer technology, new systems have more resources with each new model. A few years ago, PCs with 128mb of RAM were considered as entry level while today this limit is upgraded to at least 2 GB of memory.  Having so many resources may lead developers to adopt inefficient practices when designing applications and waste system resources. Unlike a desktop application where a single user session runs inside a single process, a Web application hosts several user sessions which run in the same process instance. In this case, resource management becomes a vital task which requires careful analysis.


Another difference is related to shared resources. In a desktop application, all resources are dedicated to one user, while in a uniGUI Web application, resources are shared among several user sessions. Any mismanagement of resources may affect the Web application server's health which may lead to server instability. One example of resource mismanagement is memory leaks. In a desktop app memory leaks can be a serious issue if it runs for extended periods of time. Since desktop apps are typically used for a few hours per day, mainly working hours, such memory leaks will not lead to serious issues. However, in a Web application, memory leaks can seriously affect server stability in a short period. If a desktop application fails, the affected user can restart it and continue its work. If a Web application fails, all connected users will be affected.


Web application servers are intended to work 24/7, so any resource management related issue can build-up over time and cause the server to run out of resources. Such conditions can lead to application server instability, and eventually to a server crash. When discussing shared resources, it is worth mentioning memory corruption problems. In a desktop application, memory corruption issues can remain undetected for a long time because such corruptions may not produce dangerous side-effects. In a Web application, memory is allocated and disposed at a very high rate in multiple threads, and any memory corruption can lead to severe server instability and erratic application behavior.


Finally, a uniGUI Web application is heavily multithreaded, and multiple sessions execute in different threads. As a result, components used in uniGUI must be multithread-aware. Components which are not multithread-aware will cause serious issues which will lead to instability of the Web server.