|
1 | 1 | # Key Concept: UI5 Over-the-Wire? |
2 | 2 |
|
| 3 | + |
| 4 | +This article provides a technical deep dive into **abap2UI5**. It is aimed at developers who want to understand how abap2UI5 works "under the hood" and how it simplifies UI5 development by keeping both logic and UI generation on the backend. |
| 5 | + |
| 6 | +It covers the core ideas behind the framework — including its architecture, codebase, and compatibility — and shows how concepts like **"HTML Over the Wire"** are adapted to the ABAP environment, offering a new approach to building UI5 applications. |
| 7 | + |
| 8 | +##### 1. HTML Over the Wire |
| 9 | + |
| 10 | +One of the core ideas behind abap2UI5 is inspired by the concept of **"HTML Over the Wire"**. This approach suggests rendering HTML directly on the server and sending it to the browser — without relying on JSON, client-side MVC frameworks, bundling, or transpiling pipelines. |
| 11 | + |
| 12 | +> 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. [...] |
| 13 | +
|
| 14 | +> 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. |
| 15 | +
|
| 16 | +The idea was introduced in the SAP community through examples using the JavaScript library **htmx** to build Fiori-like apps. Unlike typical Single Page Applications (SPAs), where state and logic reside on the frontend, the **HTML Over the Wire** principle keeps all application logic and state on the server. |
| 17 | + |
| 18 | +After the initial page load, only small HTML fragments are sent asynchronously via AJAX to update parts of the page — avoiding full reloads. |
| 19 | + |
| 20 | +<img width="400" alt="image" src="https://github.com/user-attachments/assets/a9fde24a-c572-4e5c-b203-59a0667b9931" /> |
| 21 | + |
| 22 | +_HTML "Over the Wire" Lifecycle [(Quelle)](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)_ |
| 23 | + |
| 24 | +This approach contrasts with the common separation of concerns, where HTML, CSS, and JavaScript are managed independently on the frontend while the backend only delivers data. |
| 25 | + |
| 26 | +##### 2. Hypermedia Driven App |
| 27 | + |
| 28 | +This concept evolves into what is termed a Hypermedia-Driven Application (HDA). In HDAs, the browser focuses solely on rendering HTML, CSS, and JavaScript without knowledge of the application's state. All logic is maintained on the server. |
| 29 | + |
| 30 | +In contrast, SPAs define all routes and actions upfront on the frontend, requiring a full rebuild for any modification. The following illustration compares MPAs, SPAs, and HDAs: |
| 31 | + |
| 32 | +<img width="600" alt="image" src="https://github.com/user-attachments/assets/8117dc10-f0ba-4c52-9d1d-6b9d0986401d" /> |
| 33 | + |
| 34 | +MPA vs. SPA vs. HDA [(Quelle)](https://craftcms.com/events/dot-all-2022/sessions/a-practical-guide-to-html-over-the-wire) |
| 35 | + |
| 36 | + |
| 37 | +##### 3. Rethinking Separation of Concerns |
| 38 | + |
| 39 | +Unlike traditional architectures, HDAs do not prioritize strict separation of CSS, JavaScript, and HTML. The backend generates the UI and handles program flow, much like SAP GUI applications in the past. This centralized approach simplifies customization and maintenance. |
| 40 | + |
| 41 | +##### 4. Dive Deeper |
| 42 | + |
| 43 | +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 reduce complexity while maintaining high UI fidelity. These frameworks seek a "sweet spot" between SPA and MPA architectures: |
| 44 | + |
| 45 | +<img width="600" alt="image" src="https://github.com/user-attachments/assets/41af4a41-829e-4289-82f5-18ee7408054b" /> |
| 46 | +"Sweet Spot" between SPA and MPA (Quelle) |
| 47 | + |
| 48 | +A recommended video offers an excellent introduction to these ideas. |
| 49 | + |
| 50 | +##### 5. UI5 Architecture |
| 51 | + |
| 52 | +UI5 applications typically follow an SPA architecture. The backend delivers data via OData, while all logic and UI rendering occur on the frontend. But one specific characteristic we should examine closely is how the UI5 framework creates views. Each HTML output is rendered from an XML-View (let's ignore the former HTML/JS/JSON-Views), with its associated data from the server. The view is stored at the frontend as part of the app: |
| 53 | + |
| 54 | +<img width="600" alt="image" src="https://github.com/user-attachments/assets/3b2a884e-e899-4b60-8a95-79b418f33657" /> |
| 55 | + |
| 56 | +UI5 normally - ABAP delivers only Data |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | +#### new |
| 78 | + |
3 | 79 | The key concept of **abap2UI5** is to apply the **HTML Over-the-Wire** approach to SAP UI5 application development. |
4 | 80 |
|
5 | 81 | #### Concept |
|
0 commit comments