Skip to content

Commit bd29208

Browse files
authored
Update concept.md
1 parent 892aceb commit bd29208

File tree

1 file changed

+41
-19
lines changed

1 file changed

+41
-19
lines changed

docs/advanced/technical/concept.md

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ In this architecture the initial request delivers JavaScript and CSS assets, Sub
1616

1717
<p align="center">
1818
<img width="600" alt="image" src="https://github.com/user-attachments/assets/db393f3a-940d-4bd3-aec0-5523e8d58fa0" />
19-
<br/>
20-
HTML "Over the Wire" Lifecycle
19+
<br/>
20+
<em> HTML "Over the Wire" Lifecycle</em>
2121
</p>
2222

2323
This results in a clean and lightweight frontend — a pure rendering layer — while all logic remains under full control of the backend.
@@ -57,10 +57,11 @@ UI5 freestyle apps follow the Single Page Application (SPA) model. All UI artifa
5757

5858
<p align="center">
5959
<img width="500" alt="image" src="https://github.com/user-attachments/assets/afb6e1bd-b60d-4890-ba47-5edd00da26c7" />
60-
61-
UI5 Freestyle - ABAP Stack delivers only Data
60+
<br/>
61+
<em>Freestyle - ABAP Stack delivers only Data</em>
6262
</p>
6363

64+
6465
Because UI5 is a client-side rendering framework, HTML cannot be generated on the backend and sent to the client. Instead, HTML must be generated in the browser using JavaScript and the UI5 framework.
6566

6667
#### How can we send the View from the backend?
@@ -91,39 +92,65 @@ The frontend remains unaware of the current view structure (e.g., table, list, i
9192

9293
<p align="center">
9394
<img width="500" alt="image" src="https://github.com/user-attachments/assets/ecd6e798-b6f6-4816-89ca-90f20647eb04" />
95+
<br/>
96+
<em>subtitle</em>
9497
</p>
9598

9699
With this approach, the static logic remains in the frontend, while the backend handles the dynamic logic through ABAP classes. Each app becomes a self-contained ABAP class—no need for dedicated frontend apps anymore. Previously, we had to maintain many frontend artifacts:
97100

101+
<p align="center">
98102
<img width="500" alt="image" src="https://github.com/user-attachments/assets/8b5c9b5b-3014-489f-90b4-55222744ba8a" />
99-
103+
<br/>
104+
<em>subtitle</em>
105+
</p>
100106
Now, we only need a single dummy UI5 app, and all views and logic can be centrally maintained in the backend:
101107

108+
<p align="center">
102109
<img width="500" alt="image" src="https://github.com/user-attachments/assets/79c7c6be-6424-4c33-ab3c-9c7799a74747" />
110+
</p>
111+
<br/>
112+
<em>subtitle</em>
113+
</p>
103114

104115
#### How Can We Exchange Data and Make It Editable?
105116

106117
So far, we’ve seen how to display data in a backend-driven approach. But how do we handle changes made on the frontend? If we still rely on OData, any update would typically be routed into the OData implementation layer, not into the ABAP class that also defines the view in abap2UI5. To solve this, abap2UI5 uses the concept of a View Model.
107118

108119
In standard UI5, view models (often JSON models) are used to bind attributes such as visible or enabled:
109120

110-
<img width="635" alt="image" src="https://github.com/user-attachments/assets/df92711f-abd1-4bfd-b84a-268bb452503f" />
111-
121+
<p align="center">
122+
<img width="500" alt="image" src="https://github.com/user-attachments/assets/df92711f-abd1-4bfd-b84a-268bb452503f" />
123+
</p>
124+
<br/>
125+
<em>subtitle</em>
126+
</p>
112127
Here comes the second key shift: Instead of binding to OData, abap2UI5 binds to a custom JSON model, explicitly assembled in the backend. This model is sent together with the view to the frontend:
113128

114-
<img width="1047" alt="image" src="https://github.com/user-attachments/assets/461f08c2-0f0f-424e-a7f8-008af3610258" />
115-
129+
<p align="center">
130+
<img width="500" alt="image" src="https://github.com/user-attachments/assets/461f08c2-0f0f-424e-a7f8-008af3610258" />
131+
</p>
132+
<br/>
133+
<em>subtitle</em>
134+
</p>
116135
This means we no longer consume CDS Views or OData services directly on the frontend. Instead, we send the view and its data model together from the backend. Any changes made in the UI can then be sent directly back to the backend via simple AJAX, without OData routing.
117136

118137
The abap2UI5 framework provides binding helpers and handles editable states, field values, and validation—all within ABAP classes. App developers do not need to deal with model configuration or UI binding logic manually.
119138

120139
A typical response from the backend now includes both the UI definition (view) and the data model:
121-
122-
<img width="400" alt="image" src="https://github.com/user-attachments/assets/d52112e6-b9b7-4e7f-ac7f-825c20620240" />
123-
140+
<p align="center">
141+
<img width="500" alt="image" src="https://github.com/user-attachments/assets/d52112e6-b9b7-4e7f-ac7f-825c20620240" />
142+
</p>
143+
<br/>
144+
<em>subtitle</em>
145+
</p>
124146
A complete picture of the architecture looks like this:
125147

126-
PICPICPICPIC
148+
<p align="center">
149+
<img width="500" alt="image" src="https://github.com/user-attachments/assets/d52112e6-b9b7-4e7f-ac7f-825c20620240" />
150+
</p>
151+
<br/>
152+
<em>subtitle</em>
153+
</p>
127154

128155
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.
129156

@@ -137,16 +164,13 @@ Consider this example:
137164

138165
```abap
139166
CLASS z2ui5_cl_demo_app_025 DEFINITION PUBLIC CREATE PUBLIC.
140-
141167
PUBLIC SECTION.
142168
INTERFACES z2ui5_if_app.
143169
DATA text TYPE string.
144170
DATA partly TYPE abap_bool.
145-
146171
ENDCLASS.
147172
148173
CLASS z2ui5_cl_demo_app_025 IMPLEMENTATION.
149-
150174
METHOD z2ui5_if_app~main.
151175
152176
text = text && ` text`.
@@ -156,19 +180,17 @@ CLASS z2ui5_cl_demo_app_025 IMPLEMENTATION.
156180
)->input( client->_bind( text )
157181
)->input( submit = client->_event( )
158182
)->checkbox( selected = client->_bind_edit( partly ) text = `partly` ) ).
159-
160183
ELSE.
161184
client->view_model_update( ).
162185
ENDIF.
163186
164187
ENDMETHOD.
165-
166188
ENDCLASS.
167189
```
168190
In the comparison below, you can see the difference between a full re-render and a partial view model update:
169191

170192
<p align="center">
171-
<img src="https://github.com/user-attachments/assets/79a8c531-b9a0-4bf4-bb1c-7d9019ef8707" width="400" />
193+
<img src="https://github.com/user-attachments/assets/79a8c531-b9a0-4bf4-bb1c-7d9019ef8707" width="500" />
172194
<br/>
173195
<em>You can see the difference: partly vs. not</em>
174196
</p>

0 commit comments

Comments
 (0)