Skip to main content

Denotes question regarding Magento 2 Object Manager

Large applications, such as the Magento application, use an object manager to avoid boilerplate code when composing objects during instantiation.

In the Magento framework, the implementation of the ObjectManagerInterface performs the duties of an object manager.


The object manager has the following responsibilities:

  • Object creation in factories and proxies.
  • Implementing the singleton pattern by returning the same shared instance of a class when requested.
  • Dependency management by instantiating the preferred class when a constructor requests its interface.
  • Automatically instantiating parameters in class constructors.