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

WordPress Trac noreply at wordpress.org
Wed Aug 17 22:08:19 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 schlessera):

 Now that I think about it, I might have just made some assumptions
 regarding the pattern name (have been doing too much work in that area
 lately). What you propose can indeed be called a Registry, provided that
 it never instantiates an object by itself, but only stores them. This
 would mean that the responsibility for instantiating the objects must lie
 somewhere else though.

 Opposed to that, the Service Locator would not retrieve instances to store
 them, but would rather instantiate them as needed when they are requested
 (and then storing them if they need to be shared).

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


More information about the wp-trac mailing list