Search This Blog

Showing posts with label Maintaining a Naming Convention. Show all posts
Showing posts with label Maintaining a Naming Convention. Show all posts

Sunday, July 13, 2025

Maintaining a Naming Convention

Maintaining a consistent naming convention in Oracle APEX is crucial for developing scalable, maintainable, and understandable applications. Clear and standardized names for pages, regions, items, buttons, and processes help developers quickly identify components, reduce confusion, and streamline collaboration within teams. By establishing and following a naming convention early in your project, you promote cleaner code, easier debugging, and smoother hand-offs between developers. This blog explains how to create and maintain effective naming conventions in Oracle APEX.

How to Maintain a Naming Convention in Oracle APEX

  1. Define Naming Standards for Components
    Decide on prefixes, suffixes, and formats for all APEX objects. For example:

    • Pages: P<number>_ prefix (e.g., P10_ORDERS)

    • Items: use type and purpose (e.g., P10_DATE_FROM, P10_CUSTOMER_ID)

    • Buttons: prefix with BTN_ (e.g., BTN_SAVE)

    • Regions: prefix with RGN_ (e.g., RGN_SALES_CHART)

    • Processes and Dynamic Actions: use descriptive names with a suffix indicating type (e.g., PRC_SAVE_ORDER, DA_VALIDATE_EMAIL)

  2. Use Descriptive and Consistent Names
    Avoid generic names like ITEM1 or BUTTON2. Use names that describe the purpose or content clearly.

  3. Include Object Types and Context
    Incorporate the type of object and the page or module it belongs to, making it easier to locate and understand its function.

  4. Document Your Convention
    Create a shared document or wiki page detailing naming rules and examples. This helps onboard new developers and enforces consistency.

  5. Apply Naming Conventions Early and Enforce Them
    Start using the conventions from the beginning of development and review code periodically to ensure compliance.

Best Practices for Naming Conventions

  • Keep names concise but meaningful.

  • Use uppercase letters with underscores for readability (e.g., P10_CUSTOMER_NAME).

  • Avoid reserved words or special characters that may cause conflicts.

  • Be consistent across all applications and teams to reduce confusion.

  • Use version control to monitor changes and maintain naming discipline.

 To avoid confusion, use a consistent naming pattern:

  • For Dev Work: AppName_DEV, AppName_WorkingCopy

  • For Feature Testing: AppName_NewFeature

  • For UAT Testing: AppName_UAT

  • For Performance Testing: AppName_PerfTest

Example:

Copy Type

Example Name

Main App

CustomerPortal

Dev Copy

CustomerPortal_DEV

UAT Copy

CustomerPortal_UAT

Feature Copy

CustomerPortal_NewFeature

 Manage Working Copy Data

A working copy does not automatically include production data. To work with realistic data:

  • Use a separate schema with sample/test data.

  • Clone production data into a test environment. 

CREATE TABLE customers_copy AS SELECT * FROM customers;

Use Oracle APEX REST Synchronization to pull fresh data.

 Keeping Track of Changes

Since working copies are not automatically synced with the main application:

  • Document all changes in a shared space (e.g., Notion, Confluence, or a text file).

  • Use version control (Git, SVN) to track exported .sql files.

Enable APEX Application Feedback for team reviews.

 Testing Changes Before Merging

Before merging a working copy:

  1. Run comprehensive tests

    • Functional testing (buttons, reports, forms).

    • Performance testing (APEX Debug Mode).

    • Security testing (Authentication & Session State protection).

  2. Validate changes in different screen sizes (Responsive Design).

  3. Check for JavaScript/PLSQL errors in APEX Debug Console.

 

Merging a Working Copy Back into the Main Application

Since working copies are separate, changes must be manually applied to the main app.

How to Merge a Working Copy into Production

  1. Compare pages/components between the working copy and the live application.

  2. Export required pages from the working copy: 

    • App Builder > Export/Import > Export Pages

  3. Import them into the main application.

  4. Deploy in a Staging/UAT Environment for final testing.

  5. Release to production during off-peak hours.


Deleting Unused Working Copies

Once changes are merged, delete old working copies to keep the environment clean:

BEGIN

    APEX_APPLICATION.DELETE_APPLICATION (p_application_id => 200);

END;

Alternatively, archive them in GitHub or a backup folder.


Final Thoughts: Best Practices Summary

  • Use working copies for major changes, not small fixes.

  • Follow a clear naming convention.

  • Use test data instead of modifying production data.

  • Track changes and use version control.

  • Thoroughly test before merging into the main application.

  • Delete old working copies after merging.

Oracle APEX Documentation Links

Conclusion

Maintaining a consistent naming convention in Oracle APEX is a foundational practice that enhances code clarity, maintainability, and teamwork. By establishing clear rules and applying them consistently throughout your application, you reduce errors and simplify development processes. Whether working solo or in teams, adopting a naming convention early on ensures your APEX applications remain organized and easier to support as they grow in complexity.

How Do I Make a Faceted Search Map Page in Oracle APEX

Combining faceted search with a map region in Oracle APEX enables users to filter data visually and spatially at the same time. This design ...