-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plugin system for Blueprints and Api #436
base: main
Are you sure you want to change the base?
Conversation
Introduces a plugin system to add functionality using composition instead of inheritance. This requires the plugin to be registered on the blueprint. See test_plugin.py for more details.
Hello, I also cast a vote for calling plugins for this purpose "Smore Plugins". |
Codecov ReportBase: 99.87% // Head: 99.64% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #436 +/- ##
==========================================
- Coverage 99.87% 99.64% -0.24%
==========================================
Files 13 15 +2
Lines 823 852 +29
Branches 180 186 +6
==========================================
+ Hits 822 849 +27
- Misses 0 1 +1
- Partials 1 2 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Thanks for the contribution and sorry for not answering any sooner. Please allow me a little time to give this the attention it deserves. (Don't worry about test coverage at this stage.) |
Not a problem at all. Thanks. |
I think I get the point. But it's not clear to me what it allows that can't be done without it. Admittedly, documenting a security decorator is something users have been wondering how to do and I have never really taken the time to lay this down. But I'm not sure this plugin interface is required and how much it helps. You may be interested in what I do in bemserver-api. This is the way I recommend over using In I realize this answer might not be satisfying but unless we manage to produce a very simple interface (is this even feasible?) I'm tempted to cowardly leave things as is (and point advanced users to real-life examples). I understand your point about compositing vs. subclassing. But there are so many advanced features that need subclassing that I always recommend to subclass when starting a new app, just to make it easier on the long run. And I find it nicer in the resource pages to have all features as This is not a definitive no. Just thinking out loud that this might not be needed (and I'd rather not add uneeded API surface). |
Thank you for taking the time to look this over and give your thoughts.
In all honesty, nothing at this point. I did not really intend for this to add functionality but rather to reduce the amount of knowledge a user may need about
I can agree somewhat, however, what you do in bemserver-api would require the user to understand that For instance, if I was wanting to have security schema and also give each endpoint an
I think it is feasible, though it is not clear to me how at this point. I'll have to get back to you on that. In any case, I appreciate your response. It certainly reveals quite a bit about the paradigms used. I will see what else I can come up with. I really enjoy this project (I use it a lot), so I am happy to help make it better. |
Thank you for the nice feedback. And for the constructive help. This is definitely not a no go and I'd be happy if we could go further and actually provide a nice interface for the reasons you explained above. I don't have enough time to put into this but you seem to have a good vision about it now and I'll try to be as reactive as can be. |
Introduces a plugin system to add functionality using composition instead of inheritance. This requires the plugin to be registered on the blueprint. See test_plugin.py for more details.