Renderer Refactoring » History » Version 5
Philipp Gröbelbauer, 12.06.2024 11:40
1 | 1 | Philipp Gröbelbauer | h1. Renderer Refactoring |
---|---|---|---|
2 | |||
3 | Branch: https://git.math.uzh.ch/typo3/qfq/-/tree/F17252_Renderer_Refactoring |
||
4 | |||
5 | h2. Motivation |
||
6 | 2 | Philipp Gröbelbauer | |
7 | 1 | Philipp Gröbelbauer | To achieve a more modern look and feel, QFQ Forms should support Bootstrap 5 in addition to the previously used Bootstrap 3. |
8 | However, implementing this functionality into the current codebase while still practicing "clean code" is not possible. |
||
9 | Therefore the current code is being refactored to support future expansion. |
||
10 | |||
11 | h2. Concept |
||
12 | 2 | Philipp Gröbelbauer | |
13 | 1 | Philipp Gröbelbauer | Previously, preparation and rendering of the form with all its form elements was handled in AbstractBuildForm.php and BuildFormBootstrap.php. |
14 | The new concept introduces many new classes, making the code much more modular. |
||
15 | Most notably: *Separating Configuration and Rendering of Form and FormElements* ! |
||
16 | By doing this, new Renderer Classes can be implemented in the future, which use the same AbstractFormElement objects to render the element in a different way (e.g. Bootstrap 5). |
||
17 | |||
18 | 4 | Philipp Gröbelbauer | h3. Class diagram |
19 | 1 | Philipp Gröbelbauer | |
20 | 4 | Philipp Gröbelbauer | See the class diagram below: |
21 | |||
22 | 1 | Philipp Gröbelbauer | !renderer_class_diagram_update_2024.drawio.png! |
23 | 4 | Philipp Gröbelbauer | |
24 | h3. Sequence Diagram Form and FormElement Instantiation |
||
25 | |||
26 | tbd |
||
27 | |||
28 | h3. Sequence Diagram Rendering |
||
29 | |||
30 | The diagram below describes the rendering process. |
||
31 | |||
32 | * The BaseRenderer (or any specific implementation of it) takes the previously instantiated Form object that describes all aspects of the form that is to be rendered. |
||
33 | |||
34 | 5 | Philipp Gröbelbauer | !renderer_sequence_diagram_update_2024.drawio! |