Doco HomeTutorial Home
Tutorial steps: 1,   2 and 3,   4 and 5,   6 and 7,   8

Hand editing the generated Java

The slice5.tar content is generated from the slice4.tar content by running make -s build_2, Billabong's billabong script and Squirt's squirt script. These scripts generate skeleton Java for the presentation and business layers.

At this stage, the developer should review the generated skeleton code, before hand-editing it. Why? Well, sometimes a major aspect of functionality will be wrongly described in the config files - for example, a database access that should return multiple records will be described as returning a unique record. The code generated for these two cases is quite different. If such errors are detected before the Java code is hand-edited, it is quite easy to correct the config files and regenerate the java code.

Once the generated code has been reviewed, the developer has to edit the Java code.

Business layer Java

It's at this point the business layer developer gets a lot of work. Each of the Squirt generated stub files needs to be pasted into the correct BDO-BO file. The appropriate file is determined by examining the QUERY.queryname.DO field value - just use the BO for the DO specified.

Next step is to go through the PO-BOs to find the various queries specified and to put in the appropriate code to call the generated Squirt code. The commit code has to be hand coded completely as Squirt handles read queries only. Data checking of presentation supplied values to the queries is handled in this area of the PO-BO.

The pulldown items are coded. Some of these require extracting information from the database. To see this code in the tutorial, look at the TimesheetBO.java file and examine the method getPulldownItems.

Billabong can't possibly handle all IDS in the system, as some require specific hand coding, especially those that are in the getBusinessIdValue method. To find these in the business area, search (grep) for "TODO" in the java files. If you examine the differences between the Billabong generated code and the hand edited code, you will see examples of coding for "TODO" IDS.

Finally, at least for the business layer developer, some miscellaneous coding may be required for things like user authentication. This has been done in the TimesheetBO.java. The system used assumes the web server controls access. All that's done in the tutorial is to ensure the person logged in exists in the database. An expansion on this would be to allow users with certain authorisation levels to access other users' timesheets.

Presentation layer Java

If no special functionality is required for the PO, The skeleton Java in the presentation layer is very close to the finished Java. In this case, checking each of the "TODO" marks should complete the manipulation class.

Other configuration

In the Makefiles under src/presentation/, move the POs to PO_CLASS in each of these Makefiles.

After editing the Java, the configuration files for serving the pages (eg, multiserver.conf, timesheet.conf) should be edited.

The slice6.tar contains the final (before testing!) Java code, hand-edited from the slice5.tar content.