Renderer Refactoring » History » Version 7
Philipp Gröbelbauer, 12.06.2024 11:41
1 | 1 | Philipp Gröbelbauer | h1. Renderer Refactoring |
---|---|---|---|
2 | |||
3 | 7 | Philipp Gröbelbauer | {toc} |
4 | |||
5 | 1 | Philipp Gröbelbauer | Branch: https://git.math.uzh.ch/typo3/qfq/-/tree/F17252_Renderer_Refactoring |
6 | |||
7 | h2. Motivation |
||
8 | 2 | Philipp Gröbelbauer | |
9 | 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. |
10 | However, implementing this functionality into the current codebase while still practicing "clean code" is not possible. |
||
11 | Therefore the current code is being refactored to support future expansion. |
||
12 | |||
13 | h2. Concept |
||
14 | 2 | Philipp Gröbelbauer | |
15 | 1 | Philipp Gröbelbauer | Previously, preparation and rendering of the form with all its form elements was handled in AbstractBuildForm.php and BuildFormBootstrap.php. |
16 | The new concept introduces many new classes, making the code much more modular. |
||
17 | Most notably: *Separating Configuration and Rendering of Form and FormElements* ! |
||
18 | 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). |
||
19 | |||
20 | 4 | Philipp Gröbelbauer | h3. Class diagram |
21 | 1 | Philipp Gröbelbauer | |
22 | 4 | Philipp Gröbelbauer | See the class diagram below: |
23 | |||
24 | 1 | Philipp Gröbelbauer | !renderer_class_diagram_update_2024.drawio.png! |
25 | 4 | Philipp Gröbelbauer | |
26 | h3. Sequence Diagram Form and FormElement Instantiation |
||
27 | |||
28 | tbd |
||
29 | |||
30 | h3. Sequence Diagram Rendering |
||
31 | |||
32 | The diagram below describes the rendering process. |
||
33 | |||
34 | * 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. |
||
35 | |||
36 | 6 | Philipp Gröbelbauer | !renderer_sequence_diagram_update_2024.drawio.png! |