atomic-server icon indicating copy to clipboard operation
atomic-server copied to clipboard

Refactor class extenders

Open joepio opened this issue 1 year ago • 0 comments

We have a bunch of plugins that extend functionality of Class instances:

  • Drive (adds children, could perhaps be removed)
  • ChatRoom constructs members / fetches messages
  • Invite allows for a redirect and updates usages
  • Collection constructs 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 lib project, but should probably be in server

Potential solution:

Add ClassExtender struct, register these like Endpoints

A ClassExtender should probably contain:

  • An optional get and post function (same as endpoint::handle_get / endpoint::handle_post)
  • A class Subject

joepio avatar Jul 23 '24 11:07 joepio