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]
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]
本文探讨了数据模型的设计过程,包括需求分析、用例定义、数据模型构建与完善,以及如何将数据模型转换为关系数据库。重点介绍了避免数据冗余、解决扇形陷阱和断层陷阱的方法,并讨论了一对多关系、自身关系及继承等概念。
1031

被折叠的 条评论
为什么被折叠?



