Given this grossly simplified rendition of the setup:
Why would the service appear to be
null when the method on the app’s taglib calls its superclass (the taglib on the plugin), which in turn calls the method on the service?
The best theory I could come up with is that the service is not actually being instantiated in the app’s taglib class because there are no explicit references to it aside from the
def. I presume that this is the case because if I move all the logic from service class’s method into the taglib’s method, it works as expected.
(For the sake of painting a complete picture:
MyExampleService.doMunge is called in other places, whereas the subsequent filtering (in
MyTagLib.doMungeAndFilter) is only needed for the taglib.)
Alternatively: if I move
doMungeAndFilter into another service class, creating the base version in the plugin and extending it in the app, that works fine. Which I suppose is an acceptable conclusion, though it feels like bloat to create another service class just to support the taglib like that.
Thoughts? Tips? Glaring errors or omissions?
Updated: You can comment on the Gist or else on the Stack Overflow thread.