Skip to content

Commit 14f20b6

Browse files
authored
Update concept.md
1 parent 78ccd39 commit 14f20b6

File tree

1 file changed

+40
-29
lines changed

1 file changed

+40
-29
lines changed

docs/advanced/technical/concept.md

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -53,69 +53,83 @@ Architectural Comparison:
5353
| **Over-the-Wire** | HTML fragments for partial updates | Server renders, browser inserts | 2020s (re-emerging) |
5454

5555

56-
#### How works UI5?
56+
#### How Does UI5 work?
5757

58-
UI5 freestyle apps follow the SPA model. All rtifacts are stored at the frontend and the backend supplies data through OData, while all rendering and logic execution occur in the browser:
58+
UI5 freestyle apps follow the Single Page Application (SPA) model. All UI artifacts are stored on the frontend, while the backend provides data via OData. Both rendering and logic execution occur entirely in the browser.
5959

6060
<p align="center">
6161
<img width="500" alt="image" src="https://github.com/user-attachments/assets/afb6e1bd-b60d-4890-ba47-5edd00da26c7" />
62+
63+
UI5 Freestyle - ABAP Stack delivers only Data
6264
</p>
6365

64-
UI5 Freestyle - ABAP Stack delivers only Data
66+
Because UI5 is a client-side rendering framework, the HTML cannot be generated on the backend and sent to the client. The html needs to necessarily generated at the frontend in Javascript.
67+
6568

66-
As we need UI5 for rendering the HTML and it is a client side framework we are limited here, we can not build HTML in the backend and send it from there. But there is a defining feature of UI5 and its use of XML views to generate HTML. These views reside on the frontend and are populated with server JSON data. XML-Views and JSON Darta is used by the UI5 framework to generate the HTML at the frontend.
69+
#### How can we send the View from the backend?
6770

71+
Luckily there is a defining feature of UI5 and how it generates HTML which we can use to verlangern the view generation to the backend. Usually every view relies on a xml definition the so called XML View. The ui5 framework used this xml together with the data from the backend an generates the HTML at the frontend:
6872

69-
#### Can we send the View from the backend?
73+
<p align="center">
74+
<img width="500" alt="image" src="https://github.com/user-attachments/assets/a9bf8f85-54e7-476d-be87-2cd028334d2d" />
75+
<br/>
76+
<em>UI5 Freestyle – HTML is generated from XML View and data sent via OData</em>
77+
</p>
7078

7179
abap2UI5 introduces here the first a small shift: what if the server now also delivers the xml view? The frontend becomes a passive display layer for views and data received from the server:
7280

7381
<p align="center">
74-
<img width="500" alt="image" src="https://github.com/user-attachments/assets/ecd6e798-b6f6-4816-89ca-90f20647eb04" />
82+
<img width="500" alt="image" src="https://github.com/user-attachments/assets/ec1ac3f8-65fb-4155-84f6-1ec61a088c40" />
83+
<br/>
84+
<em>UI5 Freestyle – HTML is generated from XML View and data sent bot form the server</em>
7585
</p>
86+
Although the frontend still renders HTML, all relevant information (view and data) is obtained from the backend via AJAX. The UI5 application technically remains an SPA but now functions solely as a rendering layer for the server-defined UI and Data.
7687

77-
"UI5 Over the Wire" - ABAP delivers Data & View
88+
#### How can we bring the logic to the backend?
7889

79-
Although the frontend still renders HTML, all relevant information (view and data) is obtained from the backend via AJAX. The UI5 application technically remains an SPA but now functions solely as a rendering layer for the server-defined UI and Data:
80-
<p align="center">
81-
<img width="500" alt="image" src="https://github.com/user-attachments/assets/3b464d0b-19fd-400c-a7e4-3eec893f7724" />
82-
<img width="500" alt="image" src="https://github.com/user-attachments/assets/2c9f8dc1-c6d8-4e93-80a2-b50bfc1d5ec1" />
90+
We can now easily add some interaction with putting some static code at the frontend which sends events to the backend, This process resembles the classical PAI/PBO model from SAP GUI applications. The app renders the provided view and data, then returns any triggered events to the backend, which decides what should happen next. The frontend is unaware of the current view (e.g., table, list, input) or the next actions. All logic is handled on the backend. The frontend app is a static UI5 application delivered with the first request:
8391

92+
<p align="center">
93+
<img width="500" alt="image" src="https://github.com/user-attachments/assets/ecd6e798-b6f6-4816-89ca-90f20647eb04" />
8494
</p>
85-
UI5 app downgraded - Displaying Data & View received from the server
8695

87-
The frontend is unaware of the current view (e.g., table, list, input) or the next actions. All logic is handled on the backend. The frontend app is a static UI5 application delivered with the first request:
96+
with that we get a static logoi containe at the frontend and the backend gets in abap classes the lgoc hadles. every app becomes an abap class no need for frontend apps. Before we had a lot of fronten daritfats:
8897

89-
#### How can we use the model?
98+
<img width="500" alt="image" src="https://github.com/user-attachments/assets/8b5c9b5b-3014-489f-90b4-55222744ba8a" />
9099

100+
Now we just use a single dummy app and can store all view and logic at the backend.
91101

92-
The app renders the provided view and data, then returns any triggered events to the backend, which decides what should happen next. This process resembles the classical PAI/PBO model from SAP GUI applications:
102+
<img width="500" alt="image" src="https://github.com/user-attachments/assets/79c7c6be-6424-4c33-ab3c-9c7799a74747" />
93103

94-
<p align="center">
95-
<img width="500" alt="image" src="https://github.com/user-attachments/assets/9717f500-c0de-4428-a996-11fc131c073c" />
96-
</p>
104+
#### How can we exchange data, amke it editable?
97105

98-
Communication relies on AJAX roundtrips akin to HTML Over the Wire, but pure HTML cannot be sent since UI5 still requires XML views and JSON models. abap2UI5 leverages UI5's capability to render HTML from these constructs. This results in a model referred to as _UI5-XML-View Over-the-Wire_
106+
So far we can display data and have a backend driven approach,but how can we get teh data back when someone mackes a change at the frontend, while we still relie on odata, the request would be go into our backen dodata implementtion and not in aour newly abapo classes in the backend which also sends the view.
99107

100-
_UI5-XML-View and View-Model over-the-wire_:
101-
Here is the second shift, abap2UI5 sends a View Model from the bachend. you dont need odata you can also use view models at the frontend, this is used to send it from the backend.
108+
abap2UI5 sends a View Model from the bachend. in uui cu acan also vie model. ususally they are used to bound atribute (visible/nuvisibe) and they a reused on json models:
102109

103-
A typical response in this pattern includes both view and model data:
110+
<img width="635" alt="image" src="https://github.com/user-attachments/assets/df92711f-abd1-4bfd-b84a-268bb452503f" />
104111

105-
<img width="400" alt="image" src="https://github.com/user-attachments/assets/d52112e6-b9b7-4e7f-ac7f-825c20620240" />
106112

107-
"UI5 Over the Wire" - Response with View & Data together
113+
Here is the second shift: wha if we dont bin odata, we jus bind a josn model which we explicite budk together at the backend and send wiet
114+
115+
<img width="1047" alt="image" src="https://github.com/user-attachments/assets/461f08c2-0f0f-424e-a7f8-008af3610258" />
108116

109-
#### Where is the app logic?
110117

118+
we can not consume odata or cds directly in the abap layer and only send the view + view model to the frontend. furthermore we can use make tings editable and send it directly to the backend and exchange data.
111119

120+
the abap2ui5 framework opffers binding ethods and let the attribute via classes, everyhting is handled in the backgroudn and the app developer does not need to pay attentiojto to that,
112121

113122

123+
A typical response in this pattern includes both view and model data:
124+
125+
<img width="400" alt="image" src="https://github.com/user-attachments/assets/d52112e6-b9b7-4e7f-ac7f-825c20620240" />
126+
127+
ac complete piucture looks liek this:
114128

129+
PICPICPICPIC
115130

116131
#### Partial HTML Updates
117132

118-
##### Property
119133
A central feature of HTML Over the Wire is that only the affected parts of the page are updated, rather than the entire document. Can this be achieved in UI5? While altering the XML view would typically trigger a full re-render, updating only the view model and binding attributes accordingly allows UI5 to update just the relevant UI elements. Consider this example:
120134

121135
```abap
@@ -149,9 +163,6 @@ ENDCLASS.
149163
client->view_model_update( ).
150164
```
151165

152-
##### Controls
153-
focus stays the same
154-
no feature of ui5 its just shows how the ui5 frmaework is doing a beuatiful job watching it partly rerenderig the dom.
155166
#### What about RAP?
156167

157168
Although RAP [(3)](https://pages.community.sap.com/topics/abap/rap) shifts more logic and development to the backend, it cannot be considered an “over-the-wire” approach:

0 commit comments

Comments
 (0)