Here is a small graph of classes as I see them and a description
Builders will make it possible to build a form using different ways, for example by passing just an array as parameter. The default builder will use addElement() (or its QF2 equivalent).
Behaviors will make it possible to switch element type or attributes in many (but not all) cases.
— Bertrand Mansion 2006-06-19 13:16
To better respect PEAR's coding standards and to prevent the mess which is HTML/QuickForm directory of current PEAR installation, let's use the following structure:
HTML/
QuickForm2.php # this will have the base class
QuickForm2/
Exception.php # this will contain the defined exceptions
Factory.php
Element.php
Container.php
Element/
# this will contain files with elements' classes
Container/
# this will contain files with subclasses of Container
The tests/ directory will have the same structure, following the approach of Zend Framework each directory will have an AllTests.php file which will run all tests in directory and its subdirectories.