Magento 2: Dependency Injection Adobe Commerce (formerly known as Magento) uses dependency injection (DI) to replace functionality provided by the Mage class in Magento 1.x. Dependency injection is a design pattern that allows an object to declare its dependencies to an external object that supplies those dependencies. The dependencies declared by an object are usually class interfaces, and the dependencies provided by the external object are concrete implementations for those interfaces.