Try OpenEdge Now
skip to main content
WebClient Applications
Overview : Application requirements : Modularize code by function
 

Modularize code by function

Imagine you have just designed a new application's procedures and user-defined functions, and you are now assigning each piece of code to a procedure (.p) file. At application-deployment time, you might want only certain components (groups of application files) to download initially, and other components to download only when they are first called. At design time, you can make deploying the application more efficient by the way you assign code to procedure files. Specifically, avoid assigning pieces of code that support dissimilar functions to the same procedure file, since you might want unrelated modules of an application to download at different times.
Note: However, you do not need to place all code that supports similar functions to the same procedure file, since a single component can contain multiple files.
For example, consider an insurance application that supports several different lines of insurance: life, health, automobile, fire, and disability. Assume the application has separate code supporting each line of insurance, plus general-purpose routines used throughout the application. To modularize this application by function, make sure that:
*A single procedure file does not contain routines for more that one line of insurance.
*A procedure file containing general-purpose routines does not contain specific routines for one type of insurance.
Note: If an existing application consists entirely of procedures and user-defined functions that are completely unmodular, with every routine calling every other routine, it might be difficult to have the application download incrementally. However, you can deploy the application as a single large component. For more information, see Deploying an Application.