cancel
Showing results for 
Search instead for 
Did you mean: 

Set TMap as api class to allows developers to create nice pools

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.
0 Kudos

Set TMap as api class to allows developers to create nice pools

Sometimes in custom development we need to implement a Pool (http://designpatternsphp.readthedocs.io/en/latest/Creational/Pool/README.html).

In Magento there is the \Magento\Framework\ObjectManager\TMap class, which is a generic Pool.

 

The idea is to use it as a VirtualType, or even in a composition of a Pool (as it's done for many Pools in Magento 2 core).

 

Is there any reason to make it as internal? What's the recommended way to achieve a pool with the Magento 2 stack?