As a recap, each application can be split into two parts: the Process and the Display.
Application Processes are to prepare resources that are required in the Head and Body parts. Therefore, these processes need to be in the Prelude area and produce no display. Application Display is to show the application result to the user and is in the Main Display area.
As a general design principle, one should put the code into the Application Display whenever possible, so as to minimise the processing time of the Prelude section and keep the code clean. The Application Processes are only for codes that may affect other on screen components.
A typical example is the Add-to-cart function of a shopping cart. The cart icon that shows the number of items in the cart may come before the Main Display. Therefore, this number needs to be updated upfront. So cart.bs in the Prelude area will put the item into the shopping cart, so that the number of times can be reflected in the cart icon. The acknowlegement of cart placement will be done by cart.htm in the Main Display.
|