Skip to content

Abstract Factory

Sakya edited this page Aug 1, 2022 · 2 revisions

Abstract Factory

It is recommended to use Laminas ServiceManager instead of PHP-DI as container provider

new Itseasy\Application([
   ...
   'container_provider' => Itseasy\ServiceManager\LaminasServiceManager::class
   ...
]);

Abstract factory will only be call when explicit factory definition is not found
The result of abstract factory then will be cache and become explicit factory definition in memory

Large and many Abstract factory might cause slower performance in code execution

Example Abstract Factory

  • RepositoryAbstractServiceFactory

Clone this wiki locally