Drupal code (and note I don't blame PHP here), both core and contributed, breaks the DRY principle so often, so constantly, so annoyingly repetitively, that it actually makes me (otherwise used to nicely coded object-oriented Java or C++ with model-driven support through graphical UML) feel like this:
I promote here techniques for avoiding having to Write Everything Twice (WET) (because "we enjoy typing") (where I provide some examples of typical Drupal code persistently breaking the DRY principle), and through it techniques that are friendly for IDE-prompting, as demonstrated through the truly object-oriented tutorial module OOE = Object Oriented Examples = One Of Each.
With OOE = Object Oriented Examples = One Of Each style coding,
you will never have to directly use structured arrays ever again in Drupal.
And you will never again have to repeat "by hand" or struggle to remember
those "documented" and "by convention" string keys of Drupal structured arrays !
Because the OOE bridge encapsulates them instead in classes friendly to IDE prompting.
The OOE Classes are able to pass completely valid Drupal arrays back to Drupal core for you !
© 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.