WebUi

Developer Guide

Code Architecture

The O2 GUIs follow a layered architecture:

Typical flow:
Controller → High-level Service → Low-level Service → External System

Coding Conventions

Adding a New Feature

  1. Create/Update Controller:
    • Add a new method or endpoint in the relevant controller, ending the method name with handler.
    • Validate input and call the appropriate service method.
  2. Implement Service Logic:
    • Add or update a method in a high-level service.
    • If the method fetches data from an external service, start its name with retrieve.
    • Encapsulate business logic and coordinate calls to low-level services.
  3. Update/Implement Low-level Service:
    • Add methods for direct communication with external systems if needed.
  4. Write/Update Tests:
    • Add unit tests for new or changed logic.
    • Ensure tests cover edge cases and error handling.
  5. Document:
    • Update this README or add comments/docstrings as needed.

Best Practices