Saturday, July 2, 2022
HomeWordPress Developmentcoding requirements - Are there examples of plugins utilizing depencency inversion resp....

coding requirements – Are there examples of plugins utilizing depencency inversion resp. injection as a substitute of the singleton sample


I am programming a extra advanced WordPress plugin for a lot of months now. By no means having performed such a giant plugin mission. I began with the boilerplate from Tom McFarlin and Devin Vinson (wppb.me) and modified it for my wants. Now I’ve lots of lessons, and probably the most of them used like a service and designed as Singleton. However typically I requested myself, whether or not I am doing it the best approach.

I simply made an extended analysis on the web and located many articels saying, that the singleton approach is unhealthy, and a WordPress plugin developer ought to use decoupling the entire plugin code from the WordPress core (with interfaces and wrapper lessons) and general utilizing dependency injection (dep. inversion).

However once I look on the code of the large plugins in the marketplace I can not discover any plugin utilizing such a design with DI.

My query is, whether or not there’s at the very least one instance of a well-known plugin, that makes use of depencency injection, or is that this a extra theoretical dialogue in any respect?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments