Skip to content

UI5: Architecture, State & Communication

This page compares UI5 Freestyle applications with abap2UI5, focusing on architecture, state handling, developer workflow, and client-server communication patterns.


Architecture Comparison

UI5 Freestyle

  • Frontend-centric SPA built with SAPUI5/OpenUI5.
  • Developers create XML Views, JavaScript Controllers, and Models in the frontend.
  • Application logic, navigation, and UI state are managed client-side.
  • Backend provides data via OData services (SEGW, CAP).
  • Tight coupling between frontend development and backend data provisioning.

abap2UI5

  • Static UI5 shell in the browser, no app-specific frontend code.
  • Backend defines UI5 XML Views & JSON ViewModels in ABAP.
  • Frontend simply renders the backend-provided View definitions.
  • User interactions are handled by backend logic via Over-the-Wire communication.
  • Simplified, backend-driven UI rendering with minimal frontend complexity.

State Handling

AspectUI5 Freestyleabap2UI5
State DefinitionManaged in frontend models (JSONModel, ODataModel)Managed in ABAP ViewModels
Frontend State ManagementHandled via controllers & bindingsFrontend has no state logic, purely renders backend ViewModels
PersistenceOData services persist dataBackend updates ViewModels and persists state
InteractivityEvents handled in frontend controllersEvents trigger backend logic, which returns updated ViewModels

Developer Workflow

AspectUI5 Freestyleabap2UI5
UI DefinitionXML Views & JS Controllers developed in frontendXML View & ViewModel defined in ABAP
APIsOData services required (SEGW, CAP)Generic HTTP event handler, no OData needed, Unstructured through a generic service
Frontend ArtifactsBSP or UI5 repository deployment requiredStatic UI5 Shell, no app-specific frontend deployment
Development ScopeSeparate frontend and backend developmentPure ABAP development
DeploymentFrontend & backend deployed separatelySingle ABAP transport / abapGit project
ComplexityHigh: UI5 Views, Controllers, Models + OData coordinationLow: Backend-driven simplicity

Client-Server Communication Flow

UI5 Freestyle Flow

  1. Frontend loads custom UI5 application (BSP, repository app).
  2. UI5 Views, JS Controllers, Models are loaded and executed in browser.
  3. Frontend handles UI logic, state, and user interactions.
  4. OData services are called for data retrieval & persistence.
  5. Backend returns data but does not influence UI structure or flow.
  6. Frontend updates UI models and bindings accordingly.
plaintext
Browser (UI5 Freestyle App)
  ├──> Load XML Views, Controllers, Models
  ├──> Handle events, state, navigation in frontend
  ├──> OData Calls to backend for data operations
Backend (OData Services / CAP)
  └──> Provides data, no involvement in UI rendering or logic

abap2UI5 Flow

  • Frontend loads static UI5 Shell (index.html).
  • Requests View & ViewModel from backend (ABAP Class).
  • Frontend renders UI5 controls from backend definitions.
  • User events trigger HTTP requests to backend.
  • Backend processes events, updates ViewModel.
  • Backend returns updated ViewModel.
  • Frontend re-binds UI, updating only affected controls.
plaintext
Browser (Static UI5 Shell)
  ├──> HTTP Request: Load View & ViewModel
  ├──> Render UI5 controls from backend definitions
  ├──> User events → AJAX Event Request to backend
Backend (ABAP Class)
  └──> Processes events, updates ViewModel, returns changes

Side-by-Side Comparison

AspectUI5 Freestyleabap2UI5
UI RenderingClient builds UI with XML Views & JS ControllersFrontend renders backend-defined XML View & ViewModel
CommunicationOData services (SEGW, CAP) for data operationsSimple HTTP event requests & ViewModel updates
State HandlingManaged in frontend models & controllersFully backend-driven ViewModel state
Developer WorkflowSeparate frontend (UI5) and backend (OData) developmentPure ABAP class development
Frontend ArtifactsRequires BSP or UI5 repository deploymentStatic UI5 Shell, no per-app deployment
FlexibilityHigh flexibility in frontend, but complex coordination with backendFull backend control, runtime flexibility without frontend overhead
ComplexityHigh: UI5 Views, Controllers, Models + OData + deploymentLow: ABAP-only, Over-the-Wire simplicity

Conclusion

Both UI5 Freestyle and abap2UI5 enable UI5 application development, but follow fundamentally different approaches:

  • UI5 Freestyle offers maximum frontend freedom, suitable for highly customized, interactive applications, but comes with significant complexity in development, state handling, and deployment.
  • abap2UI5 shifts UI control back to the ABAP backend, simplifying development by eliminating the need for separate frontend apps, OData services, and JavaScript controllers.

For projects where simplicity, backend-driven control, and rapid iterations are key, abap2UI5 offers a pragmatic alternative to the more frontend-heavy Freestyle approach.