惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
Check Point Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
J
Java Code Geeks
博客园 - 【当耐特】
H
Hacker News: Front Page
S
Secure Thoughts
博客园_首页
Engineering at Meta
Engineering at Meta
N
News | PayPal Newsroom
美团技术团队
SecWiki News
SecWiki News
U
Unit 42
The Hacker News
The Hacker News
有赞技术团队
有赞技术团队
T
The Exploit Database - CXSecurity.com
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
V
Vulnerabilities – Threatpost
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
F
Fortinet All Blogs
T
Tor Project blog
T
Tailwind CSS Blog
Scott Helme
Scott Helme
Recorded Future
Recorded Future
Know Your Adversary
Know Your Adversary
The Register - Security
The Register - Security
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Google DeepMind News
Google DeepMind News
S
Security @ Cisco Blogs
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
H
Heimdal Security Blog
MongoDB | Blog
MongoDB | Blog
S
Securelist
C
CXSECURITY Database RSS Feed - CXSecurity.com
雷峰网
雷峰网
博客园 - 聂微东
S
Schneier on Security
T
Tenable Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
B
Blog

博客园 - Vincent

reCaptcha 在UpdatePanel 和 ModalPopup中的使用 - Vincent Invalid character in a Base-64 string System.ArgumentOutOfRangeException at System.Web.HttpCachePolicy.UtcSetLastModified (DateTime utcDate) Fabulous Adventures In Coding Microsoft will end OEM and shrink-wrapped sales of Windows XP on June 30, 2008 - Vincent My AutoCompleteExtender Windows Live Writer GRI-MindHarbor软件公司 写给yzx110的一个实例,仅作参考! 很久没有写blog了. Base64 MD5加密 信用卡是超前消费的一种手段 vs.net2003无法打开*.xsd文件的解决方法 针对MS Project 2003 的开发 Test Your Knowledge of Microsoft Visual Studio .NET page event Microsoft Office InfoPath 2003 Toolkit for Visual Studio .NET 在Code-Behind中操作WebUserControl
单表继承 (Single Table Inheritance)
Vincent · 2005-12-25 · via 博客园 - Vincent

概念   将类的继承层次表示为一个单表,表中的各列代表不同类中的所有域.
     说白了就是把含有继承关系的类的内容都保存到一个表中.当然为了区分类的层次,不至于找儿子却找到爹的尴尬局面,要增加一个字段来保存这个层次.
运行机制 
     在这个继承映射方案中,我们使用一个表包含某个继承层次中所有类的所有数据.每个类负责把与之相关的数据保存在表的一行中.数据库中其他不相关的列留空.
     在往内存中加载一个对象的时候,必须知道实例化哪个类来创建这个对象.为此,数据表中有一个域用来指示应该使用哪个类.它可能是类的名字也可能是一个代码域.
     加载数据的时候首先读代码,看看需要实例化哪个类.保存数据的时候代码需要由层次关系中的超类写出.
优点
    1.在数据库中只需要关注一个表.
    2.获取数据时不必进行连接操作.
    3.任何对继承层次的重构都不需要修改数据库.
缺点
    1.对那些使用数据库表的用户见到列的值时有时无会感到困惑.毕竟DBA可是不看我们写的Code的.而且现在企业强调的是系统的整合,Data往往不是只为你的Application存在的.
    2.只被某些子类使用的列会带来数据空间的浪费.当然这也要分什么样的数据库产品了,Oracle对这方面处理的就比较好.
    3.因为都存在一个表中,所以数据量会变的很大,有许多索引并被频繁上锁,从而导致访问该表时效率低下.