Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make code less dependant on the container #475

Open
ghost opened this issue Mar 27, 2013 · 0 comments
Open

make code less dependant on the container #475

ghost opened this issue Mar 27, 2013 · 0 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Mar 27, 2013

Ideally, no code instantiated by the container should need to use a reference at all.
All dependencies should be set by the container on the created instance (so, all used services, etc).

Right now there is heaps of code that does $this->container->get('xxx')->doSomething();

All of 'xxx' should be set as properties on the instance, so they can be used right away.

To avoid having to create a massive amount of setter methods on existing code it might be an idea to add a generic setServices([array of service ids]) method to ZMObject (initially) and leave it to that method to depend on the container property and populate all configured services
Reporter: Martin Rademacher
Assigned to: Martin Rademacher
Begin: 2012-06-24
Completed: 0

@ghost ghost assigned DerManoMann Mar 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant