review database design

chapter 5: developing a data model
1. attribute, class and relationship
2. two or more relationship between class: cause by a special member or historical data
3. different routes of classes
1.avoid data redundancy, can not have two route to get a answer.data will be inconsistent.
2.two or relationship is needed,when one route can not get the answer.
3. Fan trap: one class has two many relationship to other classes.
4. chasm trap: add an other category for uncategroied data.
5. relationship of class itself
4. relationship involved more than two class.

chapter 6: generalization and specialization
1. when two classes have the same relation ship to another class, consider superclass and subclass them.
2. multisubclass two subclass can be achieved by superclass composite an interface and have two subclass to implement the interface.
3. using inheritance only when it is required, some time a composition is enough.

Summary about the database design:
[b]1. requirement analysis--> use case--> data model[/b]. data model are not represent the problem. it represent the data that you think is necessary to store for the problem. how the data will be used. when designing, keep asking what problem will be resolved and how the data will help.
[b]2. polish the data model[/b]
1. optional and cardinality relationship between classes
2. new class are needed when two or more class are connected to have a relationship
3. self relationship
4. 1-many relationship consider historical data
5. when two or more classes have the same relationship to another class, think about inheritance.
6. if two class have two relationship, that must have different relation information of the two class
[b]3. data model to relational database.[/b]
1. 1-many relationship add a new field (the foreign key, primary key of the 1 side) to the many side.
2. constrain of the foreign key to maintain 1-1 relationship.
not null, force an 1-many, null is a 0..1-many.
3. inheritance is a 1-0...1 relation.
4. using normalization to double check data consistency.
[b]4. use data--crud, and retrieve data.[/b]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值