RFC: Should we migrate from a Model
type to a Model
concept?
#198
PhilippMDoerner
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We use inheritance to be able to guarantee that a given Model type will have an
id
field in norm, but that isn't strictly necessary, is it?You could just as well make a concept that checks for the existence of an id field.
This would allow for greater flexibility and remove the need for inheritance, because you don't need to actually have an id-field, you need the Syntax for it.
That means you could have models without an id field, but they have procs that allow accessing and setting the field as if they had! Something like this:
In my opinion this would get rid of some of norm's limitations (enforcing the existence of an
id
column) and thus could be something worthwhile to implement in my eyes.Beta Was this translation helpful? Give feedback.
All reactions