Q: What is the point of the exercise and if you are such a keen UML/OOP nut why are there still so many static helper classes in this Flag Plus UML demo instead of classes that implement interfaces (design by contract) ?

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.

The Webel strategy for achieving this is to first migrate PHP functions from "Flatland" Drupal .module and .inc include 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.)

But to do it, you will have to trust Dr Darren and the Webel recipe for UML-friendlier PHP and leave some of the not-OO-or-UML friendly Drupal Coding Standards behind, for the same reason that Albert Einstein adopted advanced 4-vector notation and multi-dimensional tensor notations for relativistic physics. Be brave; leave Flatland.
Visit also