The main point of the UML modelling of the Flag Plus contributed module is to demonstrate that the graphical overview that UML provides can be of enormous benefit in progressively refactoring a PHP-based Drupal7 project to become at least more object-oriented. The motto is "Some OOP is still better than no OOP", and the progressive refactoring of the FlagPlus module proves this in compelling fashion.
It also demonstrates why preferring Don't Repeat Yourself (DRY Principle) "single source of truth" coding over typical Drupal7-style Write Everything Twice (WET) (because "we enjoy typing") coding is so very crucial for OOP.
.incinclude files (that do not readily admit reverse engineering into graphical UML) into helper classes (only, no interfaces yet) with completely static methods and static attributes, which classes can be reverse engineered using PEAR:PHP_UML and MagicDraw UML into graphical UML representations that can be used to plan refactorings. Then, and only then, once we have a graphical view of the system, with the help of UML - and not just with PHP code in an IDE (not half-blind) - do we plan our "design by contract" refactoring attack and identify candidate Interfaces and Classes. We then change the PHP code, reverse again, model again, and plan refactorings again.
Thus we progressively leave Drupal7 Flatland (including Drupal7's Hookland island) behind, and move into a multi-dimensional world of advanced model-driven software engineering with graphical UML support. You may even start feeling like a great-big, super-advanced, alien-like God character able to beat all of the bosses in a really tough video game. (You certainly won't miss coding Drupal7-style with by-convention-only structured arrays.)
© 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.