问题描述:

I am simply wondering if the size of the dependency injection list size might become a problem or decrease performances.

A simple case is : Is it better to have a X services or a factory that can make X new $class ?

Thanks.

网友答案:

Having a lot of services is not a bad thing at all, because they are not built until they are actualy needed. Services never used are never built.

Services are to encourage anytime possible, because while they do not impact your app's performances, they enable your code to be split in small blocks more easily maintained and tested.

Don't hesitate to check out the doc for more details.

相关阅读:
Top