4

/**
 * Registry model. Used to manage values in registry
 *
 * Registry usage as a shared service introduces temporal, hard to detect coupling into system.
 * It's usage should be avoid. Use service classes or data providers instead.
 *
 * @api
 * @deprecated
 * @since 100.0.2
 */

https://www.mageplaza.com/devdocs/magento-2-registry-register.html

enter image description here

Who can show me a demo that use service classes or data providers instead.

thx.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.