One of the neat features of the Magento application is code generation. Code generation, as implied by its name, generates nonexistent classes. These classes are generated in Magento's
The directory structure within
var/generation is somewhat similar to that of the core
app/code directories. To be more precise, it follows the module structure. The code is generated for something that is called Factory, Proxy, and Interceptor classes.
The Factory class creates an instance of a type. For example, a
var/generation/Magento/Catalog/Model/ProductFactory.php file with a
Magento\Catalog\Model\ProductFactory class has been created because somewhere within the
vendor/magento directory and ...