You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I prefer to not provide an unregister() because of the following reasons:
In most instances, registering something to hook it up to the system is much simpler than unhooking it again after the system has been run and is in an unknown state. If the interface needs an unregister(), it forces all components to think about all the possible ways an unregister() could go wrong.
If the unregister() is needed to be able to turn an individual component on or off depending on context, this has more to do with the state of that component, as it has with whether the component is "known" in the system.
As we're dealing with PHP, it can be assumed that the entire system is always discarded after each request. So unregister()ing because of memory considerations is of little use, especially as this still does not free the memory, but marks it as available to the garbage collector.
@GaryJones suggested that an
Registerable
object should be able to beunregister()
ed as well.The text was updated successfully, but these errors were encountered: