Extending Locum

Should we look at this point about how developers might extend the locum functionality? For example, a developer should be able to somehow extend the locum_client->get_bib_item() function to insert additional information into the bib record before it is passed back to the calling function.

Two ideas:

  • Implement hooks, similar to drupal: allow a custom locum module implement at hook_bib_load() function, which is called within get_bib_item() to insert additional data into the bib array.
  • Subclasses: this is currently possible, the developer would create a new class that extends locum_client and defines a new get_bib_item() function. The problem is that the calling function would have to use the new class object instead of the existing one.

Do we even want to deal with trying to change the model to accommodate local developer modifications, or just let people make their mods on their local copies for now?

I've been thinking about this too and I tend to prefer the hook model. Ideally, you should be able to "drop in" your modules into a modules directory and have locum instantiate them. Thoughts on how to do this are welcome, of course.