Skip to content

Commit 7694087

Browse files
authored
Update concept.md
1 parent f34e270 commit 7694087

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

docs/technical/concept.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
🚧 Under Construction 🚧
44

5-
This page explains the basic architecture behind abap2UI5. The core idea is based on a pattern called _HTML Over-the-Wire_, adapted for the SAP technology stack. It simplifies UI5 development by moving both UI rendering and application logic entirely to the ABAP backend.
5+
This page explains the basic architecture behind abap2UI5. The core idea is based on a pattern called _HTML Over-the-Wire_, adapted for the ABAP ecosystem. It simplifies UI5 development by moving both UI rendering and application logic entirely to the ABAP backend.
66

77
#### What is HTML Over-the-Wire?
88

@@ -72,23 +72,23 @@ Fortunately, UI5 has a defining characteristic that allows us to shift part of t
7272
<em>UI5 Freestyle – The browser renders HTML based on XML View and backend data</em>
7373
</p>
7474

75-
abap2UI5 now introduces a subtle but important shift: what if the backend also delivers the XML View?
75+
abap2UI5 introduces a subtle but important shift: what if the backend also delivers the XML View?
7676

77-
While HTML rendering still happens on the frontend, both the view definition and the corresponding data are now delivered from the backend:
77+
While HTML rendering still happens on the frontend, both the view definition and the corresponding data are now sent from the backend:
7878

7979
<p align="center">
8080
<img width="500" alt="image" src="https://github.com/user-attachments/assets/ec1ac3f8-65fb-4155-84f6-1ec61a088c40" />
8181
<br/>
8282
<em>abap2UI5 – The browser renders HTML based on XML View and data fully delivered by the backend</em>
8383
</p>
8484

85-
The UI5 application remains a single-page application (SPA), but its role changes: it becomes a pure rendering engine for server-defined views and data. How can we establish user interaction in this new scenario?
85+
The UI5 application remains a single-page application (SPA), but its role changes: it becomes a pure rendering engine for server-defined views and data. This raises a new question — how is user interaction handled in this architecture?
8686

8787
#### Handling Frontend Events in the Backend
8888

89-
To enable user interaction, a minimal static UI5 freestyle app is delivered with the initial HTTP request. This app contains just enough logic to forward frontend events to the backend. The interaction model is inspired by the classic PAI/PBO pattern from SAP GUI applications.
89+
To support user interaction, a minimal static UI5 Freestyle app is delivered with the initial HTTP request. This app contains just enough logic to forward frontend events to the backend. The interaction model is inspired by the classic PAI/PBO pattern from SAP GUI applications.
9090

91-
When the user triggers an event (e.g., button press), the event informaton is sent to the backend, where an ABAP class determines the next step. All business logic resides entirely in the backend:
91+
When the user triggers an event (e.g., a button press), the event information is sent to the backend, where an ABAP class determines what happens next. All logic is executed entirely in the backend:
9292

9393
<p align="center">
9494
<img width="500" alt="image" src="https://github.com/user-attachments/assets/ecd6e798-b6f6-4816-89ca-90f20647eb04" />
@@ -104,41 +104,44 @@ In UI5 Freestyle apps, each application required a dedicated set of frontend art
104104
<em>UI5 Freestyle – multiple frontend artifacts per app</em>
105105
</p>
106106

107-
With abap2UI5, the frontend becomes a static UI5 app shared across all applications, while all views and logic are defined and maintained in the backend. Each app is represneted by an ABAP class where the views are generated and the events are handled:
107+
With abap2UI5, the frontend becomes a static UI5 shell shared across all applications. Views and logic are fully defined and maintained in the backend. Each app is represented by a single ABAP class that generates the view and handles the events:
108108

109109
<p align="center">
110110
<img width="500" alt="image" src="https://github.com/user-attachments/assets/79c7c6be-6424-4c33-ab3c-9c7799a74747" />
111111
<br/>
112112
<em>abap2UI5 – One static frontend, all views and logic in ABAP</em>
113113
</p>
114114

115-
Furthermore every UI5 app becomes a complete ABAP backend project managed through abapGit, eliminating the need for separate frontend deployments entirely.
115+
As a result, every UI5 app becomes a complete ABAP backend project managed through abapGiteliminating the need for separate frontend deployments entirely.
116116

117117
#### Editable Data Exchange
118118

119-
So far, we’ve focused on how to display data using a backend-driven approach. But how can user input and changes made in the frontend be processed? If we were to continue relying on OData, any updates would typically be routed into the OData service layer—bypassing the ABAP class that also defines the view in abap2UI5.
119+
So far, we’ve seen how to display data and handle events using a backend-driven approach. But how can user input be processed and changes made in the frontend be transferred back to the backend?
120120

121-
Let's take a look to the UI5 Freeestyle feature and concept of view models. In UI5 Freestyle, view models (often JSON models) are used to bind attributes such as visible or enabled and binded to passgenau um control eigenschaften eines views in model attribute zu hinterlegen:
121+
If we continued relying on OData, updates would typically be routed into the OData service layer — bypassing the ABAP class that also defines the view and handles events in abap2UI5.
122+
123+
Let’s take a closer look at a key UI5 feature: the concept of view models. In UI5 Freestyle, view models are used to bind attributes such as visible or enabled — allowing control properties in the view to be mapped precisely to model attributes:
122124

123125
<p align="center">
124126
<img width="500" alt="image" src="https://github.com/user-attachments/assets/df92711f-abd1-4bfd-b84a-268bb452503f" />
125127
<br/>
126128
<em>UI5 – View model bindings for visibility and state</em>
127129
</p>
128130

129-
Here comes the second key shift: abap2UI5 nakes heavy use of View Models, instead of binding to OData it explicitly assembled in the backend after every request a dedicated view model for the actual view. This model is sent together with the view to the frontend:
131+
This leads to the second key architectural shift in abap2UI5: Instead of binding to OData, abap2UI5 assembles a custom view model entirely in the backend. This model is constructed dynamically after each request — tailored specifically to the current view — and is sent together with the view definition to the frontend:
130132

131133
<p align="center">
132134
<img width="500" alt="image" src="https://github.com/user-attachments/assets/461f08c2-0f0f-424e-a7f8-008af3610258" />
133135
<br/>
134136
<em>abap2UI5 – View and model are delivered together by the backend</em>
135137
</p>
136138

137-
This means CDS Views and OData services are no longer consumed directly on the frontend. Instead, both the view and its data model are sent from the backend in a single response. Changes made in the UI can be sent back by sending the u0pdated View Model in the baclkend again — no OData routing required.
139+
This means CDS Views and OData services are no longer consumed directly on the frontend. Instead, the complete UI state — both view and model — is sent from the backend in a single response. Any user changes in the UI are then returned to the backend via a lightweight AJAX call containing the updated view model — no OData routing involved.
140+
141+
Developers do not need to manually configure models or bindings. abap2UI5 handles this internally. All the developer needs to do is expose attributes of their ABAP class via a simple binding method — everything else is managed automatically.
138142

139-
But App developers don’t need to manually configure UI models or bindings. abap2UI5 bietet dies komplette logik im hintergrund an und als app anwender muss man lediglich die attribute seine klasse vie binding methode für den tranfer and frontend freigeben.
143+
A typical response from the backend includes both the XML view and its corresponding view model:
140144

141-
A typical response from the backend now includes both the XML View and its View Model:
142145
```json
143146
{
144147
"S_FRONT": {
@@ -157,7 +160,7 @@ A typical response from the backend now includes both the XML View and its View
157160
}
158161
}
159162
```
160-
And the associated XML View looks like this:
163+
And the corresponding XML View might look like this:
161164
```xml
162165
<mvc:View xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:form="sap.ui.layout.form" xmlns:mvc="sap.ui.core.mvc" displayBlock="true" height="100%">
163166
<Shell>
@@ -175,19 +178,21 @@ And the associated XML View looks like this:
175178
</mvc:View>
176179
```
177180

178-
This architecture results in a clean and unified application model:
181+
This architecture enables a clean and unified application model:
182+
179183
<p align="center">
180184
<img width="500" alt="image" src="https://github.com/user-attachments/assets/d52112e6-b9b7-4e7f-ac7f-825c20620240" />
181185
<br/>
182186
<em>subtitle</em>
183187
</p>
184188

189+
Frontend and backend remain tightly coupled — not through OData contracts, but through plain ABAP logic and JSON — resulting in a fully backend-driven, editable UI flow.
185190

186191
#### Efficient Partial HTML Updates
187192

188-
A central feature of the HTML Over the Wire approach is that only the affected parts of the page are updated, rather than the entire document. Can this be achieved in UI5?
193+
A core benefit of the HTML Over-the-Wire approach is that only the affected parts of the UI are updated — not the entire page. But can this pattern be applied in UI5?
189194

190-
While changing the entire XML View in UI5 typically results in a full re-render, abap2UI5 makes partial updates possible by updating only the view model. This allows UI5 to efficiently update only the relevant UI controls through data bindingwithout rebuilding the entire view.
195+
In standard UI5 behavior, updating the XML View typically triggers a full re-render. However, abap2UI5 makes partial updates possible by updating only the view model. This enables UI5 to refresh only the relevant UI controls via data bindingwithout recreating the entire view structure.
191196

192197
Consider this example:
193198

@@ -216,19 +221,19 @@ CLASS z2ui5_cl_demo_app_025 IMPLEMENTATION.
216221
ENDMETHOD.
217222
ENDCLASS.
218223
```
219-
In the following illustration, you can see the difference between a full re-render and a targeted view model update:
224+
The illustration below shows the difference between a full re-render and a targeted view model update:
220225

221226
<p align="center">
222227
<img src="https://github.com/user-attachments/assets/79a8c531-b9a0-4bf4-bb1c-7d9019ef8707" width="500" />
223228
<br/>
224229
<em>You can see the difference: partly vs. not</em>
225230
</p>
226231

227-
Thanks to UI5's powerful data binding mechanism, only the affected DOM elements are updated. This preserves the UI state—for example, the input focus remains intact—and provides a fluid user experience. This makes UI5 a perfect team player for the HTML Over-the-Wire approach, where the ABAP backend is responsible for building both the UI structure and its dynamic state. The result is an efficient, responsive, and low-maintenance application architecture that brings the best of UI5 and ABAP together.
232+
Thanks to UI5s powerful data binding mechanism, only the modified DOM elements are updated. This preserves the current UI state — such as input focus and ensures a smooth, uninterrupted user experience. The XML View and View Model concept make UI5 a perfect team player for the UI5 Over-the-Wire approach combining the strengths of ABAP and UI5 — without the complexity of full client-side re-renders.
228233

229234
#### Conclusion & Benefits
230235

231-
abap2UI5 brings the simplicity and efficiency of HTML Over-the-Wire into the ABAP ecosystem.
236+
abap2UI5 brings the simplicity and efficiency of the HTML Over-the-Wire pattern into the ABAP ecosystem — combining proven technologies with a smart UI rendering strategy.
232237

233238
Key Benefits:
234239
- Static UI5 Frontend Application: Delivered with the initial HTTP request; generic and consistent across all use cases
@@ -243,7 +248,7 @@ Limitations:
243248
- Offline functionality or complex client-side interactions are not covered
244249
- Less effective if frontend and backend teams work independently
245250

246-
By relocating UI control to the ABAP backend and using UI5 purely for HTML rendering, abap2UI5 enables pragmatic, maintainable business application development — without the complexity of SPA architectures. It offers a clean, backend-driven alternative perfect for enterprise use cases with short development cycles.
251+
By relocating UI control to the ABAP backend and using UI5 purely for HTML rendering, abap2UI5 enables pragmatic, maintainable business application development — without the complexity of SPA architectures. It offers a clean, backend-driven alternative that is ideal for enterprise use cases with short development cycles.
247252

248253
Happy ABAPing!
249254

0 commit comments

Comments
 (0)