bobmagicii, (edited )
@bobmagicii@phpc.social avatar

still struggling with trying to avoid a specific type of dependency injection.

aka i have a Video. and i have an App. the App has a Config. my Video needs to know the Config to know where to save thumbnails and find api key.

i do NOT want to pass App via DI argument. it negates the entire purpose of building a system and i'm so done with fad development lol.

shudder,
@shudder@phpc.social avatar

@bobmagicii It's called service locator and it's an anti pattern.

You can use it in abstract factory class/callback, where there won't be any dependency on (reference to) values returned from container.

You can also define composition in container itself - it will fail early in concrete place (front controller), so no major drawbacks.

bobmagicii,
@bobmagicii@phpc.social avatar

@shudder in this instance not too worried about academics making fun of the framework for being an anti pattern.

we've gone back to more larger systems, shying away from a billion microservices where everything must be ignorant of everything else around it.

but yeah sitting here just trying pattern after pattern to see if its the one that clicks with what im angry about this time 😅

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • kavyap
  • thenastyranch
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • InstantRegret
  • Youngstown
  • vwfavf
  • slotface
  • everett
  • osvaldo12
  • rosin
  • khanakhh
  • megavids
  • tester
  • Durango
  • tacticalgear
  • GTA5RPClips
  • cisconetworking
  • ethstaker
  • cubers
  • normalnudes
  • modclub
  • provamag3
  • Leos
  • anitta
  • JUstTest
  • All magazines