A Vision of the Future: What if the WordPress Plugin architecture were based on inheritance?
-
A video on the subject of better plugin development design was just posted a day ago. From Chis Pearson over on YouTube.
I have a similar model I've worked on with my own CMS and this is a reminder I should polish and document my system because it really is similar to this proposal.
-
To be honest presented code looks ugly.
I personally prefer composition over inheritance.
Mixing functionality, styling, elements all together… I’m not sure what are the improvements comparing to existing systems.I’d prefer having interface based contracts and possibility to provide implementations.
Having a plugin bootstrap would allow plugin author to bootstrap and build any possible hierarchy within the module.
In-line requires… well, even composer 1 had PSR0/PSR4 autoloaders 4 years ago.Keeping the list of installed modules is IMO better than endless inheritance extensions.
Dependency Injection is a proven way to avoid globals.All of that does not sound like Wordpress anymore. But sounds like a battle-proved receipt for a well-functioning software.