Open camsaul opened 6 years ago
I'm actually of the opinion that everything (including things like pre-insert!
) should be implemented with multimethods instead of protocols. That would be a big breaking change, however.
Is there a workaround for "different methods could be used to hydrate the same key for instances of different models"?
Instead of tagging them with metadata it would be better if we could make them multimethods that dispatch off of the model as well as the key they are hydrating. That way different methods could be used to hydrate the same key for instances of different models. The approach also seems a little cleaner than having hydrate look through all namespaces for functions with matching metadata
There are two things that might make this tricky: