[!!!][TASK] Improve FormEngine and sub classes separation
This patch improves the separation of FormEngine and its sub classes. Currently, all sub classes like single element and wizard classes get an instance of the parent object to call various methods and properties on them. This is very hard to refactor and the mesh of call trees must be simplified to ease further refactoring and improve maintainability of code. This patch follows a divide & conquer approach: * Methods only used by sub elements are moved to AbstractFormElement * Properties FormEngine "knows" that are needed by element classes are given down in a data array during element instatiation to have a clear definition of what element classes know. * Methods used by both FormEngine and sub classes that do not need an instance of FormEngine are moved to a static helper for now to reduce the amount of code in FormEngine and to mark certain areas as stateless. * Class instances are not created on a global level anymore but created only in the scope where they are used * Class instances injected by outer code are created internally for enabling the using code to be moved around. All in all, this patch is mostly a preparation of defining a fully separated structure with defined concerns for every sub class. Most methods are moved around "as is" without changing functionality. The only area that is refactored codewise is renderWizards(). There is still a nasty circular dependency between FormEngine, FlexFormElement and InlineElement. This is not resolved by the patch, but the surrounding code is now separated enough that this structure could be refactored to a tree. This may follow with other patches. This patch evolved on catharsis in branch formengine with 53 single patches. Details can be looked up there, all single patches are prefixed with [FormEngine]. https://github.com/lolli42/TYPO3.CMS-Catharsis/tree/formengine Change-Id: I332ad51f5e94c09555480099e3a8a0257bed378f Releases: master Resolves: #65357 Resolves: #63848 Resolves: #63849 Resolves: #63851 Resolves: #63853 Resolves: #63855 Resolves: #63857 Resolves: #63867 Resolves: #63868 Resolves: #63869 Resolves: #63870 Resolves: #63871 Resolves: #63872 Resolves: #63873 Resolves: #63874 Resolves: #63875 Resolves: #63877 Resolves: #63879 Resolves: #63880 Resolves: #63884 Resolves: #63885 Resolves: #63886 Resolves: #63887 Resolves: #63888 Resolves: #63890 Resolves: #63892 Reviewed-on: http://review.typo3.org/37265 Reviewed-by:Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Reviewed-by:
Wouter Wolters <typo3@wouterwolters.nl> Reviewed-by:
Benjamin Mack <benni@typo3.org> Tested-by:
Benjamin Mack <benni@typo3.org>
Showing
- typo3/sysext/backend/Classes/Controller/EditDocumentController.php 7 additions, 26 deletions...ext/backend/Classes/Controller/EditDocumentController.php
- typo3/sysext/backend/Classes/Controller/PageLayoutController.php 0 additions, 28 deletions...ysext/backend/Classes/Controller/PageLayoutController.php
- typo3/sysext/backend/Classes/Controller/SimpleDataHandlerController.php 0 additions, 1 deletion...ackend/Classes/Controller/SimpleDataHandlerController.php
- typo3/sysext/backend/Classes/Controller/Wizard/RteController.php 2 additions, 1 deletion...ysext/backend/Classes/Controller/Wizard/RteController.php
- typo3/sysext/backend/Classes/Form/DataPreprocessor.php 31 additions, 1 deletiontypo3/sysext/backend/Classes/Form/DataPreprocessor.php
- typo3/sysext/backend/Classes/Form/DatabaseFileIconsHookInterface.php 2 additions, 2 deletions...t/backend/Classes/Form/DatabaseFileIconsHookInterface.php
- typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php 841 additions, 13 deletions...sext/backend/Classes/Form/Element/AbstractFormElement.php
- typo3/sysext/backend/Classes/Form/Element/CheckboxElement.php 9 additions, 4 deletions...3/sysext/backend/Classes/Form/Element/CheckboxElement.php
- typo3/sysext/backend/Classes/Form/Element/FlexElement.php 5 additions, 4 deletionstypo3/sysext/backend/Classes/Form/Element/FlexElement.php
- typo3/sysext/backend/Classes/Form/Element/GroupElement.php 12 additions, 11 deletionstypo3/sysext/backend/Classes/Form/Element/GroupElement.php
- typo3/sysext/backend/Classes/Form/Element/InlineElement.php 56 additions, 49 deletionstypo3/sysext/backend/Classes/Form/Element/InlineElement.php
- typo3/sysext/backend/Classes/Form/Element/InputElement.php 14 additions, 5 deletionstypo3/sysext/backend/Classes/Form/Element/InputElement.php
- typo3/sysext/backend/Classes/Form/Element/NoneElement.php 137 additions, 1 deletiontypo3/sysext/backend/Classes/Form/Element/NoneElement.php
- typo3/sysext/backend/Classes/Form/Element/RadioElement.php 8 additions, 3 deletionstypo3/sysext/backend/Classes/Form/Element/RadioElement.php
- typo3/sysext/backend/Classes/Form/Element/SelectElement.php 36 additions, 33 deletionstypo3/sysext/backend/Classes/Form/Element/SelectElement.php
- typo3/sysext/backend/Classes/Form/Element/TextElement.php 57 additions, 56 deletionstypo3/sysext/backend/Classes/Form/Element/TextElement.php
- typo3/sysext/backend/Classes/Form/Element/TreeElement.php 1 addition, 1 deletiontypo3/sysext/backend/Classes/Form/Element/TreeElement.php
- typo3/sysext/backend/Classes/Form/Element/UnknownElement.php 0 additions, 1 deletiontypo3/sysext/backend/Classes/Form/Element/UnknownElement.php
- typo3/sysext/backend/Classes/Form/FlexFormsHelper.php 6 additions, 4 deletionstypo3/sysext/backend/Classes/Form/FlexFormsHelper.php
- typo3/sysext/backend/Classes/Form/FormEngine.php 2429 additions, 3342 deletionstypo3/sysext/backend/Classes/Form/FormEngine.php
Please register or sign in to comment