php - How many Dependency Injection Containers should I create? -
php - How many Dependency Injection Containers should I create? -
i have sorts of different models , many of them have @ to the lowest degree 1 dependency (usually db adapter). getting thought of dic or ioc, , i'm trying wrap head around needed - examples typically show simple creation of single object container.
if have many user models, many blog models, , sorts of others, how manage this? mutual have 1 big container, many different smaller ones, or single mill per model?
or thinking incorrectly?
note: asked below, model, believe mean "domain model". more specific - classes help me manage info specific website/application, users, blogs, etc.
one container application sufficient. there concept called composition root describes how utilize di container properly.
business model classes users, blogs etc. not pulled container. provide designated factories in turn can injected classes need create model objects.
php dependency-injection ioc-container
Comments
Post a Comment