FREN
Book a demo
THE QUADZA SUITE
QFileEncrypted, traceable file storage and sharing.QOfficeCompatible documents, spreadsheets and presentations.QMailSovereign business email.QTalkTeam instant messaging.QBoxThe appliance: the whole suite on your premises.QSearch AIIntelligent search across your data.
DEPLOYQuadza Cloud AZThe power of the cloud, full control of your data.On-PremiseYour infrastructure, your QUADZA environment.QBoxSovereignty inside your organisation.
100% compatible with Microsoft 365 & Google Workspace.
Technology

Hexagonal Architecture: Structure Your OpenEdge ABL Code

Hexagonal architecture (Ports and Adapters) separates business logic from technical details and external dependencies. Here is how to apply it in Progress OpenEdge ABL.

Patrick Martran06.05.2025 · 4 min read
Hexagonal Architecture: Structure Your OpenEdge ABL Code

Hexagonal architecture (Ports and Adapters) is a design pattern that aims to build extensible, maintainable applications by clearly separating business logic from technical details and external dependencies.

This pattern translates naturally to the Progress OpenEdge ABL language, bringing the same benefits (maintainability and the ability to evolve), and showing once again how well this platform adapts to current needs.

01Core Principle

The central idea of hexagonal architecture is to place the business domain at the heart of the application, and to surround that business logic with interfaces and adapters that connect the application to external technologies (such as databases, file systems, external APIs, etc.).

02Components of Hexagonal Architecture

Domain (Core Domain)

  • Entities: represent business objects with their properties and methods.
  • Value Objects: represent immutable objects, often used for complex data types.
  • Domain Services: contain business logic that cannot easily be placed in entities.

Application

  • Use Cases: define the specific actions the application can perform. They orchestrate calls to the domain and manage transactions.
  • Ports (Interfaces): definitions of the interfaces that adapters must implement. They connect the domain to external systems.

Ports

  • Primary Ports (Driving Ports): interfaces defining the services the application exposes to its users (for example, REST APIs or user interfaces).
  • Secondary Ports (Driven Ports): interfaces defining the external services the application uses (for example, databases or external services).

Adapters

  • Primary Adapters (Driving Adapters): concrete implementations of the primary ports. They handle interactions with users (such as REST API controllers or user interfaces).
  • Secondary Adapters (Driven Adapters): concrete implementations of the secondary ports. They handle interactions with external systems (such as database repositories or external API services).

03Workflow

  1. User interaction: users interact with the application through primary adapters (for example, by sending an HTTP request to a REST API).
  2. Use case call: the primary adapter invokes a specific use case in the application layer.
  3. Business logic: the use case calls the domain services and entities to execute the required business logic.
  4. Interaction with external systems: where needed, the use case calls secondary ports to interact with external systems through secondary adapters.
  5. Result: the use case returns the result to the primary adapter, which formats it and sends it back to the user.

04Benefits

  • Technology independence: technical dependencies and business logic are clearly separated, so you can switch technologies without affecting the domain.
  • Testability: business logic can be tested in isolation, using test doubles (mocks or stubs) for the ports.
  • Extensibility: new adapters can be added without changing the business logic.
  • Maintainability: separation of concerns makes the code cleaner and easier to maintain.

05Hexagonal Architecture Diagram

Hexagonal architecture diagram

06ABL Code Example (OpenEdge)

Domain (business logic)

File: Customer.cls

CLASS Customer: DEFINE PRIVATE VARIABLE customerId AS CHARACTER NO-UNDO. DEFINE PRIVATE VARIABLE name AS CHARACTER NO-UNDO. DEFINE PRIVATE VARIABLE email AS CHARACTER NO-UNDO. CONSTRUCTOR PUBLIC Customer (cid AS CHARACTER, cname AS CHARACTER, cemail AS CHARACTER): sc-camel-customer-id = cid. name = cname. email = cemail. END CONSTRUCTOR. METHOD PUBLIC CHARACTER getCustomerId(): RETURN customerId. END METHOD. METHOD PUBLIC CHARACTER getName(): RETURN name. END METHOD. METHOD PUBLIC CHARACTER getEmail(): RETURN email. END METHOD. END CLASS.

Application (use cases) and Ports (interfaces)

File: CustomerService.cls

USING Progress.Lang.*. INTERFACE CustomerRepository: METHOD PUBLIC VOID addCustomer(INPUT customer AS Customer). METHOD PUBLIC Customer getCustomerById(INPUT customerId AS CHARACTER).
END INTERFACE. CLASS CustomerService: DEFINE PRIVATE VARIABLE repository AS CustomerRepository NO-UNDO. CONSTRUCTOR PUBLIC CustomerService(INPUT repo AS CustomerRepository): repository = repo. END CONSTRUCTOR. METHOD PUBLIC VOID registerCustomer (customerId AS CHARACTER, name AS CHARACTER, email AS CHARACTER): DEFINE VARIABLE customer AS Customer NO-UNDO. customer = NEW Customer(customerId, name, email). repository:addCustomer(customer). END METHOD. METHOD PUBLIC Customer findCustomerById(INPUT customerId AS CHARACTER): RETURN repository:getCustomerById(customerId). END METHOD. END CLASS.

Adapters (concrete implementations)

File: CustomerRepositoryImpl.cls

USING Progress.Lang.*. CLASS CustomerRepositoryImpl IMPLEMENTS CustomerRepository: DEFINE PRIVATE TEMP-TABLE ttCustomer NO-UNDO FIELD customerId AS CHARACTER FIELD name AS CHARACTER FIELD email AS CHARACTER. METHOD PUBLIC VOID addCustomer(INPUT customer AS Customer): CREATE ttCustomer. ASSIGN ttCustomer.customerId = customer:getCustomerId() ttCustomer.name = customer:getName() ttCustomer.email = customer:getEmail(). END METHOD. METHOD PUBLIC Customer getCustomerById(INPUT customerId AS CHARACTER): FIND FIRST ttCustomer WHERE ttCustomer.customerId = customerId NO-LOCK NO-ERROR. IF AVAILABLE ttCustomer THEN RETURN NEW Customer(ttCustomer.customerId, ttCustomer.name, ttCustomer.email). ELSE RETURN ?. END METHOD. END CLASS.

Usage

File: Main.p

USING CustomerService.
USING CustomerRepositoryImpl. DEFINE VARIABLE repository AS CustomerRepositoryImpl NO-UNDO.
DEFINE VARIABLE service AS CustomerService NO-UNDO. repository = NEW CustomerRepositoryImpl().
service = NEW CustomerService(repository). service:registerCustomer("1", "John Doe", "john.doe@example.com").
MESSAGE service:findCustomerById("1"):getName().

This structure keeps a clear separation between business logic and implementation details, making the code more modular and easier to test.

07UML Representation

Class Diagram

This diagram shows the relationships between the classes in our architecture.

Class diagram

Use Case Diagram

This diagram shows the main interactions between the user and the system.

Use case diagram

Sequence Diagram

This diagram shows the order of calls between objects for a given scenario, such as registering a customer.

Sequence diagram

08Conclusion

Whether or not you work with Progress OpenEdge, hexagonal architecture lets you build robust, scalable applications by clearly separating business logic from technical details. The code becomes easier to maintain and test, with greater flexibility when technologies change.

This is especially valuable for business software publishers whose business rules are maintained over several decades.

Quadza Software can support your teams over the long term as they adopt this approach.

Patrick

Read next.

All news →
Cloud Act, Patriot Act, FISA 702: what these laws really mean for your data
Digital sovereignty

Cloud Act, Patriot Act, FISA 702: what these laws really mean for your data

User support and maintenance: cost optimisation for IT department
Opinion

User support and maintenance: cost optimisation for IT department

NEWSLETTEROne insight a month. Zero spam.Subscribe →

TRY QUADZA

Book your demo.

A video call with a QUADZA expert, on your use cases. No commitment.

01 · Duration

02 · Date

03 · Time slot

Pick a date to see available time slots.

Prefer a call back? Leave us a message