Opened 12 years ago
Closed 11 years ago
#640 closed enhancement (fixed)
Interface implementation hooks
Reported by: | Christopher Allan Webber | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 0.4.0 |
Component: | programming | Keywords: | pluginapi |
Cc: | Parent Tickets: |
Description
Sometimes we want people to supply an alternate interface to "swap out" certain things. For example, they might want a totally different user authentication system, and maybe we'd have some sort of user authentication api.
Altenately, the storage interface is a good example.
In this method we set up a minimal interface and a default implementation. Users then have the option to swap out this implementation.
I think the way storage interfaces look are already currently pretty good, so swapping out the interface could probably be like:
pluginapi.set_component('public_storage', BagOfHolding())
It turns out with hook_handle there's no need to add additional tooling to this, but I documented a nice way of using interfaces via our tooling in commit 9d881aeeb4df2e9f02c4c1fea7d6435273081fdb!