Support the ongoing development of Laravel.io →
IOC Packages Architecture
Last updated 2 years ago.
0

Am I missing something? It looks like what you're doing in the example is not DI. It's service location, which is considered as an anti-pattern.

Not to mention you're not doing DI, why do you actually need a plugin/package/extension for DI? Laravel itself is a good IOC container and capable of DI so well. You're actually downgrading yourself if you use what you do in the example.

You're going to have all the issues you mentioned IF you use your package...

Edited: after looking at the source code..it looks like the package is only for the built-in facades such as response, request, files, cache, config, and etc..

still, it's service location..and why do you want to use those facades in this way?

even if you use those built-in classes the way you're using, you will have to chance your code when switching to a new framework since those classes are framework specific classes. Do you mind to explain further?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.