2 ms·
Isn't it just sugar for what you would normally do, which is add another table with the new columns and FK into the base table? I assume it adds some protectio
by jayd16 8y ago
Isn't it just sugar for what you would normally do, which is add another table with the new columns and FK into the base table? I assume it adds some protection around type exclusivity, ie a cat row cannot be a dog row, where as you do not have that protection with cat and dog tables that both reference the animal table.
Seems nice but usually you actually would prefer composition over inheritance.
- VectorLock 8y agoIt would simplify the reflection of the schema in code I think. Also not having to do a JOIN, or make a FK, or worry about the cardinality of the FK, or worry about ON DELETE CASCADE. It seems like it wraps it up pretty succinctly.