[TYPO3-dev] Refactoring TCEforms

Andreas Wolf typo3ml at andreaswolf.info
Sun Aug 24 22:24:47 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi list!

As some may have read in the core list (discussion of RFC 8232), I am
working on refactoring TCEforms.

So, what is it about? It is *not* about rewriting TCEforms, this would
require a lot more work and also involve a prior broad discussion. I
realized a while ago that TCEforms in its current state is nowhere near
anything you could call extendable, it is just a beast of about 6500
lines of code with no real object orientation in it. Simply something
you could call modern at the times PHP4 was hot. But we are now at the
time where PHP 5.3 is at the gates, OO has been the ruling programming
paradigm for years. As we have seen with IRRE, there is really need for
making TCEforms extendable to be able to implement new features around
it. So I started with it on a boring evening with nothing else to do.

This is what I did until now:

* tear apart the old class t3lib_TCEforms
* put every element type into its own class
* put different form types into own classes (not complete)
* rebuild parts of the code to make the new class structure work
* some changes to alt_doc.php to use the new object structure

Most of the code is C&P from the old t3lib_TCEforms, only parts of it
have been really touched. Most work went into search&replace references
to the old class and vars/functions which got new names. There are also
lots of references to the old TCEforms class which need to be replaced
by new code.


This is what does not work by now (not complete!):

* IRRE has been completely left out as it is a separate class by now and
  would require some heavier refactoring (did not really dig into this)
* localization has not been tested, the same goes for FlexForms
* JavaScript may be broken at some points
* rewriting the old t3lib_TCEforms to be a wrapper for the new classes -
  this would make the transition a lot easier!

The whole project is in no way complete, tested to the last or even
bug-free. But I think it is a start. I'm of course open for comments,
bug reports and bug fixes.

The (preliminary) UML diagram of the classes/interfaces and their
relationship can be found under [1]. This is in no way complete, as is
the whole project. There are also some things which are by now not
realized, but done in some other way. The diagrams reflect how I imagine
the structure to be reasonable, but of course this is all subject to
change throughout the (hopefully following) discussions.

The code is available online, please see [2] for it. But keep in mind
that there are also other changes around it, as this project started as
a sub-project of the listmodule rewrite at the coding week in Stuttgart
at Benni Macks office. So if anything not concerning TCEforms does not
work, please drop me a note and I will create a new branch with only the
changes in TCEforms.

So, here we go, the discussion is opened and I'm excited to hear your
comments! :)


Andreas


[1] http://www.andreaswolf.info/typo3/tceforms-uml/
[2]
https://svn.typo3.org/TYPO3v4/CoreProjects/listmodule/trunk/t3lib/tceforms/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBSLHDjwJFrtzcYmY6AQjjwg//ZeeZuvbRCYY1qxPDOnBFFHm2aggCVbuJ
ZTKFy8633+FUoVL22xQ15UiPQ6XHHpO+BVAwK5umcTgl54szeu9V5xKuthg+GyxQ
tu6b4Ry2g50Z2xB2pIz1T2VpowZQnmc79BibAy3ogC+9RLhV1jSoGbSI4zYa+zwp
erwx0h08qcof1G99MIqmX9UubNYuQSzLF2vL2O7BiNLX8n+nQiXd1uOc+c0YMZ0j
hukVgWj+td79i5p5FF2qBOXVhkLdloPvuxCOEe95Whv8YpTaRmpBpq153Zllom5r
0u1L1ZBEGU5GNs51coPBLhZHQEtPDOlfYFQnlFGaY77xVOTeqBoCwo9gK4u9nXIM
zLVYB2Yjyt/2iAXyR6Q0YMxjE7CZfxq2LXg5D/SHzt4G9vIu+WPRxjFhSRediRyw
7NMsMUCKvqvQYnyk21z5KgkaM7OlqQNUGcI6FCu8Pqx/Z4OEMUyCRdgbwABFhbky
I0Liqmr+tX4jtT/csn+Yk24oE8uTbKr13RtVdpLs9AjKsVN0G/YrdnQq3fXyqJwp
3tct5k0GtjSLOFpzyY74InT39B5+o0E3EaJmaUmV0vY+aaaSSmGG2ynlK/mtWGPn
xRUSaqozbsP14hYyAd6TlkqL9b8EUKwOLITB/Y6UY7iF3uTfRJ+5jzCQ8TXAKZ0f
N1073HBYnZ8=
=o57L
-----END PGP SIGNATURE-----




More information about the TYPO3-dev mailing list