Magento – How to get current product in Magento 2.3.1 without deprecations

deprecatedmagento2magento2.3.1product

Not a duplicate question, as the referenced original question uses deprecated classes.

I want to get the current product in a Block / Model in Magento 2.3.1. I cannot directly use / inject / extend any deprecated classes like Registry / AbstractProduct. Must use DI and not ObjectManager

What is the best alternative for this?

Best Answer

There is a solution suggested at https://www.atwix.com/magento-2/alternatives-for-deprecated-registry-class-magento-2-3/

Also, there is discussion in the comment section of the article on the other alternative options.