Every time I’ve personally started off with a protocol for some generic piece of functionality, I’ve eventually switched to a behaviour. I believe they are both more explicit and more flexible, and lend themselves well to the defoverridable strategy that @al2o3cr mentioned.
defmodule AdminResources.User do
use Admin.Resource, schema: App.Accounts.User
# defines default impls for all required callbacks
# override where needed
@impl true
def whatever do
…
end
end


















