I see that Magento 2 has 3 factory classes (4 if you count the abstract one).
- \Magento\Framework\ObjectManager\Factory\Dynamic\Developer
- \Magento\Framework\ObjectManager\Factory\Dynamic\Production
- \Magento\Framework\ObjectManager\Factory\Compiled
All of the above extend \Magento\Framework\ObjectManager\Factory\AbstractFactory
.
I assumed that when on developer mode, the Developer
factory would be used, but sometimes the Compiled
one is used and I cannot pinpoint the conditions for this.
Can someone please explain when each factory is used and what are the differences between them?