- Issue created by @donquixote
- 🇦🇺Australia dpi Perth, Australia
HuxModuleHandlerProxyTrait exists only to satisfy the implementation of all of ModuleHandlerInterface in a code-clean way, rather than polluting HuxModuleHandler.
The API of HuxModuleHandlerProxyTrait is such that there is a symbiosis with HuxModuleHandler. The trait is effectively sealed; is not allowed to be used by any other class. HuxModuleHandlerProxyTrait even has methods that are overridden by HuxModuleHandler, and are thusly never invoked.
As for the 'proxy' naming, I dont exactly recall why its named that. Maybe a refactor, maybe legitimate reasoning, but its inconsequential in the end, per the sealed rationale.
HuxModuleHandler itself is a decorator, and the "inner" convention comes from Symfony itself.
raises the question whether the properties should be private or protected.
This also does not matter as HuxModuleHandler is final, nobody is permitted to use extend or read it.
I originally had the plan to only call methods on inner from the trait, but you can see I did end up calling it from HuxModuleHandler (perhaps out of laziness). Ideally HuxModuleHandler reach out to the trait methods instead.
--
Addressing this issue in the context of the core-implementation, Hux features would be brought into ModuleHandler proper so this trait and the decorator would not be present.
- 🇩🇪Germany donquixote
Addressing this issue in the context of the core-implementation, Hux features would be brought into ModuleHandler proper so this trait and the decorator would not be present.
True.
I think it is worthwhile to review some design choices if we plan to move into core, but for this one it seems not really necessary.
I mostly raise these issues because I wanted to work on the new attribute interface, and I like to do some clean-up in preparation.
Also, to have a nice starting point for core. - 🇩🇪Germany donquixote
I found that *Decorator(Base) and ->decorated-> is more common in Drupal core.
I find only one ->inner-> and no *ProxyBase or *ProxyTrait.Rename now part of 📌 Combined refactoring and attributes interface Needs review
- Status changed to Closed: works as designed
almost 2 years ago 2:25am 18 June 2023 - 🇦🇺Australia dpi Perth, Australia
Closing based on
Makes things consistent, for maintaining Hux.
Will not be necessary, if in core.