Mage::Registry in Magento 2

- Magento 2

Magento 2 Development

Mage::Registry in Magento 2  is very similar to the registry of Magento 1. You can find it here: \Magento\Framework\Registry

Utilize dependency injection for adding it to the constructor. As a result, you will be able to use both $registry->register($key, $value) and $registry->registry($key) methods to store / access data.

More tips from Magento 2 Developer’s Cookbook

'

Source (Magento Stackexchange Question) (Ryan H)

'