单表继承或类表继承? [英] Single Table Inheritance or Class Table Inheritance?

查看:436
本文介绍了单表继承或类表继承?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读关于类表继承(CTI),并发现我更喜欢它。我有这个问题,请问有什么具体的单表继承(STI)用例,您可以在CTI上使用这种用法?



我读了 http://rhnh.net/2010 / 07/02/3-reason-why-you-should-not-use-single-table-inheritance ,据我所知,这是坚实的。 STI的用例是行为差异而不是数据。

解决方案

我想指出一个伟大的文章已经发现解释为什么和何时使用CTI。 LINK


I'm reading about Class Table Inheritance (CTI) and finding I prefer it overall. The question I have is, is there any specific use case for Single Table Inheritance (STI) where you'd use that over CTI?

I read http://rhnh.net/2010/07/02/3-reasons-why-you-should-not-use-single-table-inheritance and as far as I know, it's solid. The use case for STI being a difference in behaviour but not data.

解决方案

I would like to point you to a great article I have found that explains with clarity why and when to use CTI. LINK

这篇关于单表继承或类表继承?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆