In migrating from Drupal7 function-and-hook "flatland" to a more OOP and UML-friendly world we endeavour to: Create "bridge" include files that mediate between the classic Drupal7 hooks of the .module file and OO Class libraries that progressively encapsulate define() data and functions as Class attributes, constants, and Interface/Class methods
A guiding principle is that a form-related include bridge file should use one and one only helper/builder class, as was achieved for flagplus.entitytype.inc, with delegation from each of the form _build(), _ajax(), _validate() and _submit() functions.
flagplus.flags.inc currently handles roughly 3 sets of closely related but differently implemented functionality:
1. A passive readonly page view of the applicability of each flag by entity type and bundle.
2. An editable view (with an entity type filter) of the applicability of each flag by entity type and bundle, with sub-forms for each table for flag applicability by bundle.
3. An editable AJAX view (with an AJAX entity type filter) of the applicability of each flag by entity type and bundle, with AJAX sub-forms for each table for flag applicability by bundle.
We can see this in the (overly complex) main diagram below through the 3 sets of dependencies on the 3 subclasses of
Don't be discouraged if your UML overview diagrams are at first too complex, that is just your UML model telling you something very important, it is inviting you to refactor your system ! And the way to refactor it is to first identify such "scenarios" in separate diagrams. Later, these might become diagrams for dedicated Classes that correspond to a dedicated narrative.
© Copyright 2001 - 2016 Webel IT Australia (ABN: 67 677 268 579). All rights reserved (except as specified below).
PHP code examples from Webel IT Australia on this site are distributed under the GNU General Public License.
Excludes text and code snippets from Drupal.org quoted for educational purposes.
Drupal’s online documentation is © 2000-2014 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0.
PHP code from Drupal.org is distributed under the GNU General Public License.
Drupal® is a registered trademark of Dries Buytaert.
Text quoted from Wikipedia for educational purposes is made available under the Creative Commons Attribution-ShareAlike License.
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.
Site developed by Webel IT Australia.