[wp-trac] [WordPress Trac] #37699: Death to Globals Episode #1: A Registry, A Pattern

WordPress Trac noreply at wordpress.org
Sun Sep 4 09:29:58 UTC 2016


#37699: Death to Globals Episode #1: A Registry, A Pattern
----------------------------+------------------
 Reporter:  wonderboymusic  |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  4.7
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------

Comment (by F J Kaiser):

 @MikeSchinkel

     The use of a {{{WP::get( 'whatever' )}}} seems over-architected and
 with no benefits I can perceive when we can just as easily use
 {{{WP::whatever()}}}. Especially when whatever is known in advance as it
 is with all existing globals. Better to create hardcoded methods that each
 have their own PHPDoc and each can trigger autocomplete in an IDE (without
 requiring complex machinations to get autocomplete to work.)

 Having {{{WP::get( 'dragons' )}}} is the opposite of ''over-architected''.
 That is ''well-architected'' as it is open for extension – without
 constantly changing the access layer to the code base as soon as a new
 object gets implemented. What you are searching for is called
 ''convenience-architected''. If you believe you need convenience-wrappers,
 then put a Facade in front of it, as already proposed by @jacobsantos .
 This is the proper way to hide away complexity.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37699#comment:78>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list