atomic-server
atomic-server copied to clipboard
Refactor class extenders
We have a bunch of plugins that extend functionality of Class instances:
-
Drive(addschildren, could perhaps be removed) -
ChatRoomconstructsmembers/ fetches messages -
Inviteallows for aredirectand updatesusages -
Collectionconstructs members through a custom query
I'm not happy with how it currently works:
- There is some code duplication in
get_resource_extended - It's not really pluggable, contrary to Endpoints (which can be registered on Store)
- Code is in the
libproject, but should probably be inserver
Potential solution:
Add ClassExtender struct, register these like Endpoints
A ClassExtender should probably contain:
- An optional
getandpostfunction (same asendpoint::handle_get/endpoint::handle_post) - A class Subject