03.12.2015 Views

laravel4cookbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Packages 144<br />

involves telling the container how and where to find the instances so that they can be resolved<br />

as required.<br />

This naturally aids dependency injection as class instances adhering to abstracted requirements can<br />

easily be resolved without first creating. To put it another way; if our classes adhere to certain<br />

requirements (via interfaces) and the IoC container can resolve them to class instances, then we<br />

don’t have to do it beforehand.<br />

The easiest way to understand this is to look at some code:<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!