Skip to content
Snippets Groups Projects
Commit 212b9dbf authored by Christian Kuhn's avatar Christian Kuhn Committed by Anja Leichsenring
Browse files

[!!!][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: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarBenjamin Mack <benni@typo3.org>
Tested-by: default avatarBenjamin Mack <benni@typo3.org>
parent 223237b8
Branches
Tags
No related merge requests found
Showing
with 3653 additions and 3586 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment