
|
IntroductionProGen WebSmart has many facilities for enabling you to leverage existing application logic in WebSmart web applications. These facilities make it possible for you to reuse code with ease, and to separate the business rules and database processing from the user interface. For example, you might have a complex item pricing module that depends on a customer's purchasing volume, region or number of units ordered. You can package that module in any number of ways so that it can be readily included in your application's business logic in WebSmart produced applications. Types of Code Components You Can IncludeWebSmart has features for supporting almost any kind of code or application logic you may have on your AS/400. These include objects such as programs, modules or service programs, or code snippets such as subroutines or inline code fragments. There is also full support for RPG ILE subprocedure or C function calls (a module or service program may contain any number of subprocedures or functions, for example). Object Calls
Any of these calls can send or receive information using parameters or, in the case of Java, a similar mechanism. The WebSmart programming language, PML, includes instructions to allow you to directly call these objects and to send or receive parameters . These are the CALL and CALLB functions, similar to how you would code them in ILE RPG. Code Snippets and SubroutinesAny code snippet written in ILE RPG can also be included. Your code snippet can consist of a combination of global (program level) or local (subprocedure level) variables (D-specs) or calculations. When the code is included in the generated program, the generator sorts out which part of the source the D-specs belong in. It also eliminates duplicate field declarations. This means your code snippets can be self-contained, complete pieces of code from one source member, instead of having to create 2 or more source members- one for the D-Specs and another for the calculations (C-specs). You can include code snippets in several ways:
Note that when you use this feature, you are actually extending the language vocabulary. These extensions are stored in files that are unaffected by subsequent installs of the product, so you never have to worry about losing them. In addition, you get all the benefits of the IDE' s PML editing features with this approach: color coding, prototyping, type-checking and syntax checking. How WebSmart Handles Binding in Modules and Service ProgramsWhenever you use the CALLB function in PML, WebSmart automatically adds a binding entry to the compile command when the program is compiled, to ensure that the module you have referenced is automatically bound in by copy in your program. There is also a user-customizable binding directory included with the product. You can add entries to this for either modules or service programs to automatically bind the objects needed whenever you compile any WebSmart program. Please note that the presence of an entry in the binding directory does not mean that your objects are cluttered with unnecessary modules or references to service programs. The compiler is smart enough to only include those objects really used by a program. If you choose to extend the PML by creating customized functions that depend on calls to modules or service programs, you can also add entries to the user-customizable binding directory in order to ensure that when these functions are used, any necessary modules or service programs are bound in. Modifying the Templates to Include Legacy CodeIf there is a standard piece of legacy code that you want to include in every WebSmart definition you create (perhaps you have a standard security function), you can modify the templates to include PML code to invoke that routine - whether via a program field, a CALL or CALLB, or with a user-defined function. Of course, you can include any number of standard routines. By changing the templates before you start the code writing phase of your project, you guarantee that each program you produce will contain the legacy code. Using the Central Repository to Include Legacy CodeFor any field in any file, you can include references to legacy code by writing PML functions such as CALL or CALLB, or user-defined functions and store this information in the Central Repository. Then, whenever you reference that field as you are designing your program, the PML extensions will be included, thus referencing your legacy code. SummaryProGen WebSmart provides you with the best of both worlds when it comes to web application development. You get a robust, easy to use design tool that lets you build browser-based user interfaces that take maximum advantage of the browser's presentation features, you get a comprehensive programming language for writing web-based programming logic, and you can easily incorporate existing application logic into your WebSmart web applications. All these features, along with the wizards for quickly building applications, make it possible for you and your development team to reach an unsurpassed level of productivity and efficiency in producing scaleable, secure and robust AS/400 web applications. |
||||||||||||||||||||||||||||||||||||||||||||||||