[wp-trac] [WordPress Trac] #37699: Death to Globals Episode #1: A Registry, A Pattern
WordPress Trac
noreply at wordpress.org
Thu Aug 18 21:25:07 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 wonderboymusic):
@tfrommen the point isn't to commit everything into trunk at once, the
point is to use less globals in WordPress. The ideal is no global
variables, but there is no chance of that happening and maintaining BC. In
the meantime, let us imagine what incremental changes we can make that
look towards that future.
DI is an idea, not a requirement. Using composition is incremental, not a
final solution. If we decide to use a Service Locator, we now only need to
update 5 properties, instead of 40 instances within the methods. We could
make the decision to use DI, or not, I haven't decided if the extra args
are a good idea or not, but I do think composition is an improvement.
We are in Alpha, this is exactly when changes like this go into trunk.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37699#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list