Skip to content

Commit fcf5190

Browse files
committed
docs: split technical deep dive into four navigable parts
Restructure of the Technical Insights section. The old "Behind the Scenes" page packed 29 sections and 374 lines into a single document — a decent reference, but unfriendly for readers who want to dive in step by step or jump to one specific topic. The deep dive is now split into four pages, with the original URL (/technical/how_it_all_works) repurposed as a landing/index. No existing URL breaks. New pages under /technical/deep_dive/: - foundations.md — HTML Over the Wire, HDAs, sweet spot, UI5 architecture (was sections 1-5). - architecture.md — UI5 Over the Wire, generic HTTP service, runtime View and Model, RAP comparison (was sections 6-14). - lifecycle.md — the abap2UI5 app, drafts, initial request, no-extra-layer, _bind / _event, custom JS (was sections 15-22). - tradeoffs.md — downsides vs UI5/RAP, system footprint, running everywhere, downporting, summary (was sections 23-28 + 29). Each part has its own intro framing what's covered, ends with a "What's Next" pointer to the following part, and back-links to the previous one. Sidebar reorganization: - New "Deep Dive" group expanded by default, listing all four parts plus the index. - "Technology" renamed to "Comparisons" and given an index entry (technology/overview). - "Tools" collapsed by default to keep the sidebar manageable. Cross-linking pass: - concept.md (top-level architecture intro) now ends with a "Want to Go Deeper?" footer pointing into the deep dive. - dx.md and cloud.md get Next-Steps footers. - technology/* pages (overview, rap, ui5) get See Also sections back into the deep dive. - All tools pages (abapgit, ajson, srtti, abaplint, open_abap, abap_cleaner, abapmerge) get See Also footers connecting them to the architecture context where they matter. Internal-link audit run after the changes — no broken targets. https://claude.ai/code/session_011kvL4ihgqWYQa2SSufEaKv
1 parent 2db39f8 commit fcf5190

19 files changed

Lines changed: 555 additions & 365 deletions

docs/.vitepress/config.mjs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,31 @@ export default defineConfig({
244244
{ text: "UI5 Over-the-Wire", link: "/technical/concept" },
245245
{ text: "ABAP Thinking, UI5 Results", link: "/technical/dx" },
246246
{ text: "Cloud Readiness", link: "/technical/cloud" },
247-
{ text: "Behind the Scenes", link: "/technical/how_it_all_works" },
248247
{
249-
text: "Technology",
248+
text: "Deep Dive",
249+
link: "/technical/how_it_all_works",
250+
collapsed: false,
251+
items: [
252+
{ text: "Behind the Scenes", link: "/technical/how_it_all_works" },
253+
{ text: "1. Foundations", link: "/technical/deep_dive/foundations" },
254+
{ text: "2. The abap2UI5 Architecture", link: "/technical/deep_dive/architecture" },
255+
{ text: "3. Inside an App", link: "/technical/deep_dive/lifecycle" },
256+
{ text: "4. Trade-offs and Compatibility", link: "/technical/deep_dive/tradeoffs" },
257+
],
258+
},
259+
{
260+
text: "Comparisons",
250261
link: "/technical/technology/overview",
262+
collapsed: true,
251263
items: [
252-
{ text: "RAP", link: "/technical/technology/rap" },
253-
{ text: "UI5 Freestyle", link: "/technical/technology/ui5" },
264+
{ text: "Technology Overview", link: "/technical/technology/overview" },
265+
{ text: "RAP vs. abap2UI5", link: "/technical/technology/rap" },
266+
{ text: "UI5 Freestyle vs. abap2UI5", link: "/technical/technology/ui5" },
254267
],
255268
},
256269
{
257270
text: "Tools",
258-
collapsed: false,
271+
collapsed: true,
259272
items: [
260273
{ text: "abapGit", link: "/technical/tools/abapgit" },
261274
{ text: "ajson", link: "/technical/tools/ajson" },

docs/technical/cloud.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,9 @@ abap2UI5 offers an alternative, especially for developers who want lightweight a
126126
abap2UI5 is fully cloud-ready. It supports modern, backend-driven UI5 development while staying upgrade-stable and compatible with SAP BTP ABAP Environment and S/4HANA Public Cloud. Each app can be built cloud-ready, making abap2UI5 a strong complement to existing RAP or UI5 freestyle apps.
127127

128128
Happy ABAPing!
129+
130+
## Next Steps
131+
132+
- **[RAP vs. abap2UI5](/technical/technology/rap)** — when to pick one over the other.
133+
- **[Compatibility & Downporting](/technical/deep_dive/tradeoffs#compatibility-and-downporting)** — how a single codebase covers everything from NW 7.02 up to ABAP Cloud.
134+
- **[Use Cases](/get_started/use_cases)** — concrete extension scenarios on cloud and on-stack systems.

docs/technical/concept.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,20 @@ By moving UI control to the ABAP backend and keeping UI5 only for HTML rendering
254254

255255
Happy ABAPing!
256256

257-
**References:**
257+
## Want to Go Deeper?
258+
259+
This page introduces the architecture. The full deep dive walks through the implementation:
260+
261+
- **[Behind the Scenes](/technical/how_it_all_works)** — guided tour through the four parts of the deep dive.
262+
- **[Foundations](/technical/deep_dive/foundations)** — HTML Over the Wire, HDAs, and how UI5 fits in.
263+
- **[The abap2UI5 Architecture](/technical/deep_dive/architecture)** — generic HTTP service, runtime View and Model.
264+
- **[Inside an App](/technical/deep_dive/lifecycle)** — drafts, lifecycle, `_bind` / `_event`.
265+
- **[Trade-offs and Compatibility](/technical/deep_dive/tradeoffs)** — downsides, footprint, downporting.
266+
267+
For comparisons against other approaches: **[RAP vs. abap2UI5](/technical/technology/rap)** and **[UI5 Freestyle vs. abap2UI5](/technical/technology/ui5)**.
268+
269+
## References
270+
258271
- [htmx in a nutshell](https://htmx.org/docs/#introduction)
259272
- [HTML Over the Wire](https://signalvnoise.com/svn3/html-over-the-wire/)
260273
- [Fiori-like web app development in pure ABAP with htmx and Fundamental](https://community.sap.com/t5/technology-blog-posts-by-members/fiori-like-web-app-development-in-pure-abap-with-htmx-and-fundamental/ba-p/13500763)
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
---
2+
outline: [2, 3]
3+
---
4+
# The abap2UI5 Architecture
5+
6+
_Part 2 of the architectural deep dive._
7+
8+
The previous part covered the patterns that inspired abap2UI5: HTML Over the Wire, hypermedia-driven apps, and the role of XML Views in UI5. This page shows how those ideas turn into a concrete architecture — one where the backend ships **both** the View and the data, a single generic HTTP service serves every app, and Model and View are defined at runtime.
9+
10+
## UI5 Over the Wire
11+
12+
abap2UI5 introduces a key change: the backend also sends the view. This shifts the frontend's role toward an HDA that shows views and data received from the server.
13+
14+
<img width="600" alt="'UI5 Over the Wire' - ABAP delivers Data & View together" src="https://github.com/user-attachments/assets/9717f500-c0de-4428-a996-11fc131c073c" />
15+
16+
_"UI5 Over the Wire" — ABAP delivers Data & View together._
17+
18+
Although the app still depends on frontend HTML rendering, it now fetches everything it needs (view and data) over AJAX from the backend. The UI5 app stays a SPA, but its role shrinks to that of an HDA — responsible only for showing the view and its data:
19+
20+
<img width="600" alt="UI5 app downgraded to an HDA - Displaying Data & View received from the server" src="https://github.com/user-attachments/assets/17a3a301-b698-4704-9cbc-43798c5bd600" />
21+
22+
_UI5 app downgraded to an HDA — displaying Data & View received from the server._
23+
24+
This means the frontend app doesn't know what it's showing (whether a table, list, or input), nor does it know which actions come next. The app logic lives entirely on the server, and the first request delivers the frontend app as just a small HDA:
25+
26+
<img width="600" alt="'UI5 Over the Wire' - Server to Client Communication" src="https://github.com/user-attachments/assets/2c9f8dc1-c6d8-4e93-80a2-b50bfc1d5ec1" />
27+
28+
_"UI5 Over the Wire" — Server to Client Communication._
29+
30+
The HDA shows the view with its data and sends each event back to the server, which decides the next action and output. This resembles the PAI/PBO process from classic SAP GUI apps:
31+
32+
<img width="600" alt="UI5 vs. 'UI5 Over the Wire' - Communication" src="https://github.com/user-attachments/assets/3b464d0b-19fd-400c-a7e4-3eec893f7724" />
33+
34+
_UI5 vs. "UI5 Over the Wire" — Communication._
35+
36+
The framework borrows the AJAX roundtrip pattern from "HTML Over the Wire", but UI5 doesn't allow direct HTML injection. Instead, every response carries a **View** along with its **Data** — a pattern best described as "UI5 View Over the Wire".
37+
38+
## Merging Data and Presentation
39+
40+
A typical "UI5-View Over the Wire" response looks like this:
41+
42+
<img width="600" alt="'UI5 Over the Wire' - Response with View & Data together" src="https://github.com/user-attachments/assets/d52112e6-b9b7-4e7f-ac7f-825c20620240" />
43+
44+
_"UI5 Over the Wire" — Response with View & Data together._
45+
46+
But isn't this the same as RAP, just in a different format?
47+
48+
## How RAP Compares
49+
50+
RAP also aims for a "sweet spot" between SPA and MPA. The exact mechanism RAP uses to bring its view and model to the frontend isn't fully documented, but it enriches responses either in the JSON itself or in the metadata of the initial OData request — and CDS Views on the backend define the view and model up front:
51+
52+
<img width="600" alt="RAP - Definition of Views with UI Annotations" src="https://github.com/user-attachments/assets/a79f07ff-594d-422c-b66f-8acf8058c81a" />
53+
54+
_RAP — Definition of Views with UI Annotations._
55+
56+
<img width="600" alt="RAP - Definition of Data Models with DDL" src="https://github.com/user-attachments/assets/66b8935f-f23a-4b08-bd1d-6ec79f220499" />
57+
58+
_RAP — Definition of Data Models with DDL._
59+
60+
This also yields an architecture with a thin frontend and a strong backend, similar to an HDA. But RAP aims for this in a well-organized, controlled way: every API relies on the OData protocol, UI annotations define the views, DDL defines the data models, local implementations of RAP classes handle model updates, and everything splits into layers managed via a Virtual Data Model.
61+
62+
But when major Model and View changes are needed at runtime, this approach can be too rigid. Model changes with RTTI aren't supported, and extending the view quickly exceeds the scope of backend annotations — needing Fiori Elements apps (which again require extra deployment).
63+
64+
Overall, RAP doesn't mix View, Model, and Logic as boldly as the "Over the Wire" approaches. As an open-source project, abap2UI5 can take the next steps without that organizational ceremony.
65+
66+
## One HTTP Service for All Apps
67+
68+
First, abap2UI5 doesn't define a specific HTTP service for sending the View and Data. Instead, every app uses the **same generic HTTP handler** with two strings (one for the View and one for the Data), dropping the need to build individual OData services with SEGW or CDS. At runtime, the framework converts ABAP variables and tables into a JSON model and sends them as a string to the frontend. JavaScript then parses it back into a JSON model and binds it to the UI5 View:
69+
70+
<img width="600" alt="Data Transfer in abap2UI5 - ABAP variables & tables are automatically synchronized with the UI5-Model" src="https://github.com/user-attachments/assets/163ca12b-fe37-43e8-80b6-a5eaae703d69" />
71+
72+
_Data Transfer in abap2UI5 — ABAP variables & tables are automatically synchronized with the UI5 Model._
73+
74+
A second twist: the framework sends **not only the data but also the metadata** (Data Model) with every request. This differs from classic OData communication, where the initial OData request carries the metadata to set up the model up front, and only data moves afterward. With this approach, you can send a different model on every request:
75+
76+
<img width="600" alt="OData vs. UI5 Over the Wire - Model & Data transfer" src="https://github.com/user-attachments/assets/95fe59c3-7e8a-4e21-8690-12de1110779f" />
77+
78+
_OData vs. UI5 Over the Wire — Model & Data transfer._
79+
80+
## Defining the Model at Runtime
81+
82+
This lets the framework define models not just at design time, but at runtime too. The user needs no extra work — abap2UI5 handles the entire process in the background on every AJAX request:
83+
84+
<img width="600" alt="abap2UI5 - Dynamic Data Binding & Model Creation" src="https://github.com/user-attachments/assets/e9f1bf8c-6d8c-44ad-ba89-c3648b638335" />
85+
86+
_abap2UI5 — Dynamic Data Binding & Model Creation._
87+
88+
In apps, RTTI returns to the toolkit, like ALVs used to do. There is no longer a separate app per model. In the demo below, an abap2UI5 app holds a table whose type is created and changed at runtime (similar to SE16):
89+
90+
![SE16-like runtime table where the data model is generated at runtime via RTTI](https://github.com/user-attachments/assets/20b4a140-7954-45b0-8d0e-8aa1e8a6f1f5)
91+
92+
_Replacing the Model (metadata) at runtime._
93+
94+
## Defining the View at Runtime
95+
96+
The same applies to the view. In RAP, only certain predefined control attributes change at runtime, while CDS artifacts with UI annotations define the view itself up front. In an abap2UI5 app, by contrast, you can swap entire view controls. For example, the app below swaps a table control for a list control and back:
97+
98+
![Swapping a table control for a list control at runtime from the ABAP backend](https://github.com/user-attachments/assets/b6e081e4-2eae-4175-aca8-fc761b145762)
99+
100+
_Replacing the View at runtime._
101+
102+
## View and Model Independent of the HTTP Service
103+
104+
As a result, the View and Model stay independent of the HTTP service, and the framework doesn't ship a predefined static OData service for every app, as RAP does. This greatly cuts the number of backend artifacts:
105+
106+
<img width="600" alt="RAP vs. Model & View decoupled from the (single & generic) HTTP-Service" src="https://github.com/user-attachments/assets/6fb61790-87bc-47fa-855e-83d5292b70f3" />
107+
108+
_RAP vs. Model & View decoupled from the (single & generic) HTTP service._
109+
110+
Let's look at the HTTP handler that gives this flexibility.
111+
112+
## The Generic HTTP Handler
113+
114+
All apps and data models share the same generic HTTP handler — set a breakpoint in your app and check the call stack to confirm it.
115+
116+
<img width="600" alt="Call stack of an abap2UI5 app" src="https://github.com/user-attachments/assets/1ce80652-4105-4ee5-84e8-35a87eb47556" />
117+
118+
_Call stack of an abap2UI5 app._
119+
120+
Every app implementation is a REST-based HTTP POST implementation that keeps no session between requests.
121+
122+
## REST and Live Editing
123+
124+
This makes abap2UI5 compatible with all mobile use cases and devices, and with RESTful environments like the BTP ABAP Environment and the ABAP Cloud language version. Like an OData implementation, where the app reflects data changes without a restart, the entire app can be edited and its view changed without restarting the frontend app:
125+
126+
![Live editing the ABAP class with the UI updating without reloading the frontend app](https://github.com/user-attachments/assets/c2c1afce-7d72-46a2-b0a7-7725c70bf5f4)
127+
128+
_Developing the ABAP class without restarting the frontend app._
129+
130+
This also brings the advantage shared by all over-the-wire approaches: no more cache busting, since the frontend app stays unchanged throughout the development cycle.
131+
132+
So far, the abap2UI5 frontend app doesn't know the specific app — and the generic HTTP service on the server doesn't know the specific model and view it's sending. So which layer actually decides what happens?
133+
134+
## What's Next
135+
136+
The answer lives in a single ABAP class per app. The next part walks through the lifecycle of an app, how state survives between stateless roundtrips via drafts, and how the framework keeps the `_bind` and `_event` mechanism small.
137+
138+
→ Continue with **[Inside an App](/technical/deep_dive/lifecycle)**.
139+
140+
← Back to **[Foundations](/technical/deep_dive/foundations)**.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
outline: [2, 3]
3+
---
4+
# Foundations
5+
6+
_Part 1 of the architectural deep dive._
7+
8+
Before looking at how abap2UI5 works internally, this page covers the ideas that inspired its architecture: HTML Over the Wire, hypermedia-driven applications, and how UI5 itself is structured.
9+
10+
The pattern is older than the framework. Frameworks like Phoenix LiveView (2018) and Laravel Livewire (2019) reintroduced server-driven UI updates years before abap2UI5 carried the same idea into UI5. Understanding that lineage makes the rest of the deep dive easier to follow.
11+
12+
## HTML Over the Wire
13+
14+
The concept of **"HTML Over the Wire"** inspired one of the core ideas behind abap2UI5. This approach renders HTML directly on the server and sends it to the browser — with no need for JSON, client-side MVC frameworks, bundling, or transpiling pipelines.
15+
16+
> You can write fast, modern, responsive web applications by generating your HTML on the server, and delivering that directly to the browser. You don't need JSON as an in-between format. You don't need client-side MVC frameworks. You don't need complicated bundling and transpiling pipelines. But you do need to think different. [...]
17+
18+
> This is what HTML Over The Wire is all about. It's a celebration of the simplicity in HTML as the format for carrying data and presentation together, whether this is delivered on the first load or with subsequent dynamic updates.
19+
20+
The SAP community introduced this idea with examples that use the JavaScript library **htmx** to build Fiori-like apps. Unlike typical SPAs where state and logic live on the frontend, the **HTML Over the Wire** principle keeps all app logic and state on the server.
21+
22+
After the initial page load, the server pushes small HTML fragments asynchronously over AJAX to update parts of the page — avoiding full reloads.
23+
24+
<img width="400" alt="HTML 'Over the Wire' Lifecycle" src="https://github.com/user-attachments/assets/a9fde24a-c572-4e5c-b203-59a0667b9931" />
25+
26+
_HTML "Over the Wire" Lifecycle [(Source)](https://community.sap.com/t5/technology-blog-posts-by-members/fiori-like-web-app-development-in-pure-abap-with-htmx-and-fundamental/ba-p/13500763)_
27+
28+
This approach contrasts with the common separation of concerns, where HTML, CSS, and JavaScript are handled separately on the frontend while the backend only delivers data.
29+
30+
## Hypermedia-Driven Apps
31+
32+
This concept evolves into a **Hypermedia-Driven Application (HDA)**. In HDAs, the browser focuses only on rendering HTML, CSS, and JavaScript without knowing the app's state. All logic lives on the server.
33+
34+
By contrast, SPAs define all routes and actions up front on the frontend, needing a full rebuild for any change. The illustration below compares MPAs, SPAs, and HDAs:
35+
36+
<img width="600" alt="MPA vs. SPA vs. HDA" src="https://github.com/user-attachments/assets/8117dc10-f0ba-4c52-9d1d-6b9d0986401d" />
37+
38+
_MPA vs. SPA vs. HDA [(Source)](https://craftcms.com/events/dot-all-2022/sessions/a-practical-guide-to-html-over-the-wire)_
39+
40+
## Rethinking Separation of Concerns
41+
42+
Unlike traditional architectures, HDAs don't enforce strict separation of CSS, JavaScript, and HTML. The backend builds the UI and handles program flow — much like SAP GUI apps did in the past. This unified approach simplifies customization and maintenance.
43+
44+
## The Sweet Spot Between SPA and MPA
45+
46+
Frameworks like Phoenix LiveView (2018) and Laravel Livewire (2019) were among the first to adopt this principle. Tools like htmx, Hotwire, and Unpoly followed, aiming to cut complexity while keeping high UI fidelity. These frameworks aim for a "sweet spot" between SPA and MPA architectures:
47+
48+
<img width="600" alt="'Sweet Spot' between SPA and MPA" src="https://github.com/user-attachments/assets/41af4a41-829e-4289-82f5-18ee7408054b" />
49+
50+
_"Sweet Spot" between SPA and MPA_
51+
52+
A recommended video offers a good introduction to these ideas.
53+
54+
## How UI5 Fits In
55+
56+
UI5 apps usually follow an SPA architecture: the backend delivers data via OData, while all logic and UI rendering run on the frontend. But one trait is worth a closer look — **how UI5 creates views**. UI5 renders each HTML output from an XML View (ignoring the older HTML/JS/JSON Views), with its matching data from the server. The frontend keeps the view as part of the app:
57+
58+
<img width="600" alt="UI5 normally - ABAP delivers only Data" src="https://github.com/user-attachments/assets/3b2a884e-e899-4b60-8a95-79b418f33657" />
59+
60+
_UI5 normally — ABAP delivers only Data._
61+
62+
This is the hook abap2UI5 uses. If the XML View is just a string, it doesn't have to live on the frontend — it can be sent from the backend on every request.
63+
64+
## What's Next
65+
66+
That's exactly what abap2UI5 does. The next part of the deep dive shows how the framework moves the view to the backend, how a single generic HTTP service serves every app, and why the View and Model can be defined entirely at runtime.
67+
68+
→ Continue with **[The abap2UI5 Architecture](/technical/deep_dive/architecture)**.

0 commit comments

Comments
 (0)