OERA/OEAA
The OpenEdge Reference Architecture (OERA) and OpenEdge Application Architecture (OEAA) are both built on the concept of layered design. Each layer is responsible for a distinct aspect of the application, such as data access, business logic, or the service interface, ensuring consistency and flexibility in how components are reused.
What is Application Architecture?
Application architecture defines how application components are structured and communicate. It simplifies development, reduces costs, and provides clear guidelines for modifications and testing.
Why Do We Need Architecture?
- Reduces complexity with consistent services.
- It cuts redundancy and technology sprawl.
- It provides a roadmap for modifications.
- It simplifies testing by isolating components.
Layered Architecture
OEAA is built on layered architecture (n-tier) and the Common Component Specification (CCS). Layers are independent, making applications easier to modify without affecting other parts.
- User Interaction: Handles user input.
- Business Logic (BL): Contains core functionality.
- Data Access (DA): Manages connections to data sources.
OEAA Design Principles
- Layered Application Design: Separates client (UI) and server (services). Server includes business logic and data access, promoting reusability.
- Service-Oriented Design: A service-first approach where business logic is exposed via APIs for easy client access (REST/SOAP/ABL).
OERA vs. OEAA
OERA provides high-level guidelines for application design, focusing on scalability and performance. In contrast, OEAA translates these principles into a structured, layered architecture tailored for development.
OEAA offers several advantages:
- Modularity: Enables updates or replacements of components without impacting the entire system, enhancing maintainability.
- Reusability: Allows components to be reused across applications, reducing redundancy.
- Service Orientation: Facilitates easier integration with clients and systems, improving flexibility.
- Clear Guidelines: Provides specific implementation details that help developers adhere to best practices.
OEAA Components
Business Entity (BE): Manages specific business logic and data.
Do’s:
- Have a 1:1 mapping between the BE and its corresponding Service Interface (SI) and Data Access (DA).
- Access other Business Entities (BEs) when needed.
- Perform data validation.
- Manage updates to data and compute business logic.
Don’ts:
- Do not access other Data Accesses (DAs).
- Avoid using your BE in other Service Interfaces.
- Do not access data directly outside the BE.
Code example:
/*......................................................................................................
Purpose: Create proposals by calling the method CreateProposal from ProposalDA class
Notes:
@param: dsProposal as the dataset, contains the records that should be created
......................................................................................................*/
method public void CreateProposal (input-output dataset dsProposal):
define variable lIsValid Proposal as logical no-undo.
for each ttProposal no-lock:
lIsValidProposal = ValidateProposal().
end.
if lIsValidProposal then
this-object:oProposalDA:CreateProposal (input-output dataset dsProposal by-reference).
end method.
Business Task (BT): Coordinates updates across entities.
Do’s:
- Coordinate updates for different Business Entities (BEs).
- Compute business logic relevant to the task.
- Manage task completion or callbacks.
Don’ts:
- Do not access other Data Accesses (DAs).
- Avoid accessing data directly.
Data Access (DA) and Data Source (DS): Handle database interactions.
Code example:
/*------------------------------------------------------------------
Purpose: Create proposals based on the dataset dsProposal
Notes:
@param: dsProposal as the dataset, contains the records that should be created
--------------------------------------------------------------------*/
method public void CreateProposal(input-output dataset dsProposal):
define variable mCoverImage as memptr no-undo.
define variable lcData as longchar no-undo.
for each ttProposal no-lock
where ttProposal.ProposalId = "":
create bufProposal.
buffer-copy ttProposal except AppUserId ProposalId CreatedAt CreatedTimestamp CoverImage to bufProposal.
assign
bufProposal.AppUserId = SessionContext:AppUserId
bufProposal.OrganizationId = SessionContext:OrganizationId
bufProposal.CreatedAt = now
bufProposal.CreatedTimestamp = now
bufProposal.LastUpdatedTimestamp = now
bufProposal.ProposalId = guide
ttProposal.AppUserId = bufProposal.AppUserId
ttProposal.OrganizationId = bufProposal.OrganizationId
ttProposal.ProposalId = bufProposal.ProposalId
ttProposal.CreatedAt = bufProposal.CreatedAt
ttProposal.CreatedTimestamp = bufProposal.CreatedTimestamp
ttProposal.LastUpdatedTimestamp = bufProposal.LastUpdatedTimestamp.
copy-lob from ttProposal.CoverImage to lcData.
mCoverImage = base64-decode(lcData).
copy-lob from mCoverImage to bufProposal.CoverImage.
end.
finally:
set-size(mCoverImage) = 0.
release bufProposal.
end
end method.
Service Interface (SI): Defines how clients (REST/SOAP/ABL, etc.) access the business logic.
Code example:
/*------------------------------------------------------------------
Purpose: Create proposals by calling the method CreateProposal from ProposalBE class
Notes:
@param: dsProposal as the dataset, contains the records that should be created
--------------------------------------------------------------------*/
@openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="false").
method public void CreateProposal(input-output dataset dsProposal):
this-object:oProposalBE:CreateProposal(input-output dataset dsProposal by-reference).
end method.
OEAA enhances OERA by promoting modular, service-based design, ensuring applications are scalable, flexible, and easy to maintain.
Author: Andreea Sturze, Developer
Andreea is the one who always makes the office feel like home, inviting us in with open arms and good vibes. Need help? She’s there. Hungry? She’s already ordering food. Party time? She’s the life of it! And despite the cold, she’s always up for a break outside with us. Cute, kind, and endlessly fun—Andreea is simply the best!