Developer: PL/SQL
  DOWNLOAD
Oracle Database XE
  TAGS
xe, apex, webdev, All

Best Practices for Oracle Application Express Collaborative Development


by Ben Wootton

Practical strategies for ensuring a smooth team-based development process

Published June 2006

Oracle Application Express, the rapid Web application development tool integrated with Oracle Database 10g, is a tool primarily aimed at creating workgroup-level applications. However, many customers embark on projects—large enough to require teams of two or more developers—that exceed the scope of a single workgroup. Although these collaborative development efforts generally work well, a few practical problems and communication issues can arise if not properly managed.

Fortunately, it takes only the application of simple Oracle Application Express features combined with simple project controls to avoid problems and to keep the development process smooth and efficient. This article offers an overview of these steps and presents lessons learnt from relatively large Application Express projects.

Useful Features

First, let's cover some specific features of Oracle Application Express that have been created specifically with collaboration in mind—and others that are useful in encouraging consistency, even on a smaller project.

Page locks. The most useful tool available to an Oracle Application Express development team is the page locking functionality. Page locks solve the most common collaborative development problem, a situation in which two developers accidentally edit the same page concurrently. When this happens, the first person to save changes will be successful but the second person’s save will fail, because that person’s version of the page is stale—potentially resulting in loss of work.

Page locks allow a developer to lock a page prior to editing it. The developer who locks the page can edit it as normal, but other developers are prevented from navigating to the page for editing—avoiding any risk of losing work. This restriction remains in place until the page is unlocked. Therefore, remembering to unlock pages after edits is as important to the team development process as is using them in the first place.

You can lock a page or unlock it for editing by selecting the padlock icon next to the page in the Application Builder, as shown below. Note that each lock allows for a comment, which, although not mandatory, is a useful aid to communication within the team.

Figure 1

Page groups. It’s possible to form logical page groups and assign each page in your application to one of them. Doing so is not only valuable in terms of being able to navigate and locate the pages you need to edit quickly but can also be useful as a way of allocating and signifying developer ownership for every page in a team development setting if each functional area is maintained by an individual developer. Note that using page groups is purely a development convenience—they have no implications for how the application operates.

To create a page group, select Manage Page Groups from the task list on the Application Builder screen. Select Create, and specify a name and a description. Again, populating the description field can aid communication within the team.

Once you’ve created your page groups, you can assign pages to them by navigating to the Page Definition screen for an existing page and populating the Group field, as shown below. You can also specify page groups as part of a new-page creation process, so it’s worth investing some time at the outset of your collaborative Oracle Application Express project in deciding on which page groups to use.

Figure 2

The page groups you use will depend very much on your application, but as a rule, try to keep groups fine-grained enough that each group contains 10 to 20 pages—any more or less, and you begin to lose the benefits of the page group division.

Comments. Every page and every page item (region, item, process, or branch) has a comment field at the bottom of its configuration page. Although commenting every page item is probably unnecessary, making use of this field is advisable for documenting pages, processes, and branches as an aid to other developers. These comments can be of a technical nature, because they aren’t exposed to the application at all.

For many page items, you will find this comment field prepopulated with the creation date and time:

Figure 3

Any PL/SQL or SQL processes that are associated with a page (such as a process, conditional, or branch) and any complex JavaScript, CSS, or HTML code should also be commented inline for the benefit of other developers who may have to visit the code at a later stage.

Beyond this, ensuring that your application is as self-documenting as possible through the use of descriptive page names and items becomes more important in a collaborative development project.

Application reports. Oracle Application Express provides a suite of reports detailing the makeup of your application. To locate these, navigate to th e Application Builder for your application and click View Application Reports on the Tasks menu on the right.

In a collaborative development project, it’s useful to periodically view the shared component reports and move any repeated static or local lists of values into global scope for sharing between other developers. This reuse decreases maintenance for individual developers and again improves consistency. The developer assigned to this task should police why any potentially useful list of values is being created as static or local to a page—and should educate users so that this is avoided in the future.

Second, and perhaps more interesting from a team-development perspective, are the activity reports. These show “changes by developer” reports and charts that not only allow you to settle any team arguments about who has been working harder but also have value for auditing and for locating the source of introduced bugs.

Figure 4

PL/SQL functions and procedures. Although it’s possible to include PL/SQL or SQL queries directly inline for page processes, validations, and conditionals, doing so is commonly the wrong choice for maximizing reuse and manageability. A better option is to move any procedure or function that is likely to be used in multiple locations or by multiple developers into a database object via the object browser and then to call this logic as a function from within your page item.

Figure 5

Functions can be created and packaged by use of Oracle Application Express ’ built-in SQL command window and object browser.

Page 0. Page 0 serves as a special function in Oracle Application Express. It’s never accessed directly—rather, items on it are rendered as part of every other page in your application. Making full use of Page 0 is a useful productivity boost even in a small project, but it becomes particularly useful in a collaborative development project, in which consistency is harder to enforce and where any saved work is multiplied across the entire team.

Page 0 is created in the same way as any other page. Note, however, that only page items can be created on Page 0—no processes or computations can be added to this page.

As an aside, a common question in the OTN forums is how to suppress Page 0 items on some subset of your applications pages. This is possible, so concern about item suppression shouldn’t be an excuse to completely avoid using Page 0 in a large project or collaborative setting. You can suppress items by navigating to Page 0, selecting the item you want to conditionally suppress, and setting the following condition on this item—adding the page to the list on which you would like to suppress the item in question.

Figure 6

Templates and CSS. Like Page 0, templates and CSS can improve consistency across the user interface of your application. Because this is perhaps the key challenge in an Oracle Application Express team development setting, it’s useful for at least one member of the development team to have a full appreciation of how they are used and what the possibilities are. In larger teams, the ideal situation is to task one or two developers purely with this and broader interface design responsibilities, keeping such considerations separate from development proper. These developers should also assume these responsibilities after the bulk of the functional design has taken place.

If you are adding any formatting or items to individual page items or pages—or if you find yourself adding a lot of HTML inline into page items—you should consider whether you can achieve the same thing by modifying a template or creating a custom style. Many people miss opportunities to use these features—creating more work for themselves in producing and maintaining a consistent user interface.

Full instructions for templating and CSS are beyond the scope of this article, but Scott Spendolini’s article “Cloning Your Corporate UI With HTML DB” may prove to be a useful resource in this regard.

Project Controls

Several more-generic project controls may be useful to implement on a collaborative Oracle Application Express project.

Roles and responsibilities. As a generic software development best practice, clearly assigning roles and responsibilities to individual developers usually makes tea m development smoother.

This is equally true in Oracle Application Express. You should consider creating roles for managing the database objects; the packaging of PL/SQL functions; the shared components; creation of the help text; and as mentioned, customization of the templates and CSS. When all requests for creation or modification of these objects are sent through a single person, consistency is improved and accidental replication of logic or items in the database is avoided.

Development environment and versioning. Many development teams have created development, staging, and production Oracle Application Express environments and move code between these environments as a manual import/export process. Implementing such a system is worthwhile (or possibly absolutely necessary) as your project grows in size and number of users.

Some teams also use versioning systems to retain versions of their application. Typically, the development team exports its application into a SQL script and checks it in to the versioning system on a regular basis. To export your application, select the relevant option from the Application Builder menu on the Oracle Application Express home page.

Figure 7

Although these points do not refer specifically to collaborative development, they recognize that team development implies slightly elevated risk and that therefore any effort to increase robustness and recoverability should be made.

Using Multiple Applications

For very large projects, you should consider dividing your system into multiple Oracle Application Express applications, each with their own application ID and with each application being executed as a separate functional unit.

This does bring overhead in regard to managing templates, CSS, and shared components. However, much of this can be mitigated by use of the increasingly useful page publish and subscription functionality.

Such a system may also require a custom authentication scheme. Again, this is beyond the scope of this article, but the HTML DB help topic “About Creating an Authentication Scheme from Scratch” is a useful starting point if you decide to take this route.

This sounds like a lot of work, but the advantage is that development on the individual applications can progress in a completely isolated fashion and that with the functional units communicating via well-defined interfaces, the application becomes more modular and loosely coupled and therefore easier to maintain.

Summary

This article has covered features and project controls that help keep your Oracle Application Express collaborative development projects smooth, efficient, and consistent. Each of these require at least some effort on the part of individual developers, but this effort is typically paid back many times over at the end of the project, when effort isn’t needed to resolve integration problems and to mass-modify the interface for consistency.


Benjamin Wootton is an Associate Technical Consultant with Oracle Consulting in the UK.
E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy