开发者

Using OO Inheritance in database vs. Normalization rules

How should you design your database? Using OO inheritance principes or using database normalization ru开发者_运维百科les? Which do you prefer? Why? Thanks.


If you are designing a relational database, then you should use the relational model. Use normalization techniques when appropriate, which is most of the time, but not always.

The relational model has no exact analog to OO inheritance. If you need to express the class subclass relationship in a relational model, look up "generalization specialization relational modeling".


Database should be created using normalization techniques.

When you want to map your database to a OO model, you can use one of the following three techniques to design your DB that are described in the Hibernate documentation. (Those techniques conform to normalization rules as well):

Inheritance Mapping strategies

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜