Open jondwillis opened 11 years ago
Okay, this is because annotations cannot be inherited. I tried forking and adding @Inherited annotation to InjectPojo, but that did not work. I have limited knowledge of annotations, but I'll keep prying around a little bit.
@jondwillis, I remember putting this off and eluding to it in the documentation till the API became stable and all the implications of supporting features along an inheritance hierarchy were considered... and then I guess I forgot about it. Should have used gh-issues from the beginning.
In my opinion, if we allow a single feature to span the inheritance hierarchy it will make the whole API be perceived as such. So you'd expect other features like state management with @Stateful
to be available as well. Supporting inheritance hierarchies should be an API-wide concern and I agree that it must be addressed. Let's start with dependency injection.
@sahan I agree, check out my pull request. I haven't thoroughly tested everything, but it is working right now for @InjectPojo in a very simple use-case.
@sahan PS, I am really enjoying this library in my most recent project. I'll try sharing it and endorsing it on various sites so it can get more love from the community.
A few things to consider,
@InjectAll
on the base or root class of the hierarchy.@Title
should not be overridden by any ancestors.@Layout
injection on fields should be refactored to enable injection resolution....and possibly more.
@jondwillis, I'll review the pull request.
@sahan It was really more of a conversation starter than anything, but I appreciate it.
@jondwillis I went through the code and it looks good. I've added some line notes on jondwillis/IckleBot@a455c6f68617e532b9af0af5b1dc4a46cb90f45f based on my view. Mention me in a comment when you've reviewed them and I can merge the code.
@jondwillis And by the way, thank you for your personal endorsement. It's great to hear that someone's making use of it in a project.
Injection seems to fail, resulting in a thrown
NullPointerException
in the following case:Is this by design or is it intentional? Either way, it was unexpected behavior and is limiting my design.