One of Magento 2's features is the registry pattern, which makes objects and data accessible in the public scope. These objects and data can thus be used by any resource. For instance, the internal registry, which serves as the global-scoped container for data storage, can be used to store all singleton patterns. In this case, objects and data are registered using the Mage::register function. Using the mage::unregister function, you can register data and objects in reverse.