Download presentation
Presentation is loading. Please wait.
Published byThomas Gordon Modified over 9 years ago
1
Conceptual Data Modeling
3
What Is a Conceptual Data Model? A detailed model that shows the overall structure of organizational data A detailed model that shows the overall structure of organizational data It is independent of any database management system or other implementation considerations. It is independent of any database management system or other implementation considerations. Represented by UML class diagrams Represented by UML class diagrams
4
Use cases are key inputs to conceptual data modeling.
7
Conceptual Data Model Elements Classes Classes Attributes Attributes Identifiers Identifiers Associations, aggregations, compositions Associations, aggregations, compositions Generalizations Generalizations Time dimensions Time dimensions Integrity rules Integrity rules Security controls Security controls
8
Object/Class/Instance Class : Class : – A person, place, thing, event, or concept in user environment about which organization wishes to maintain data. – It is a set of objects that share the same attributes, operations, relationships, and semantics (abstract). Object : Object : – A single occurrence of a class; encapsulates data and behavior. (Examples: product, employee, order, line item) Instance: Instance: – A single object (concrete). (i.e. John Smith, student)
9
Class Instances
10
UML Class symbol has three parts: 1)Name 2)List of attributes 3)List of operations
11
Types of Attributes Simple attributes – contain single data item (i.e. name) Simple attributes – contain single data item (i.e. name) Identifiers (aka Primary Key) – contain unique key value for class (i.e. studentId in Student class) Identifiers (aka Primary Key) – contain unique key value for class (i.e. studentId in Student class) Multivalued attributes – contain multiple values simultaneously (i.e. phone number – may have several phone numbers - home, cell, beeper) Multivalued attributes – contain multiple values simultaneously (i.e. phone number – may have several phone numbers - home, cell, beeper) Composite attributes – group of related attributes Composite attributes – group of related attributes (i.e. address – contains sub-attributes of street, city, state, zip)
12
Stereotypes in Class Diagrams Stereotype – a construct that extends the UML vocabulary Stereotype – a construct that extends the UML vocabulary Identifier stereotype > for primary key Identifier stereotype > for primary key Multivalued stereotype > Multivalued stereotype > Since there are no standard UML symbols for primary key or multivalued they are created using stereotypes Since there are no standard UML symbols for primary key or multivalued they are created using stereotypes
13
Primary key is a unique identifier; no two Student instances will have the same studentId value.
14
Multivalued attribute can contain multiple values; a student may have several phone numbers
15
Composite attributes have multiple sections (subattributes). They are treated as separate classes in conceptual data models.
16
Selecting Primary Keys Choose a primary key that will not change its value over the life of each object of the class (i.e. name and address changes so they are not good candidates) Choose a primary key that will not change its value over the life of each object of the class (i.e. name and address changes so they are not good candidates) Choose a primary key such that, for each object of the class, the attribute is guaranteed to have valid values and not be null. (include controls in data entry and maintenance routines to eliminate errors) Choose a primary key such that, for each object of the class, the attribute is guaranteed to have valid values and not be null. (include controls in data entry and maintenance routines to eliminate errors) Avoid the use of so-called intelligent keys. For instance, the 1 st two digits stand for a warehouse location or region. These conditions can change. Avoid the use of so-called intelligent keys. For instance, the 1 st two digits stand for a warehouse location or region. These conditions can change. Consider substituting single-attribute surrogate keys for large composite keys. Consider substituting single-attribute surrogate keys for large composite keys.
17
What Is A Relationship? A semantic connection between objects of one or more classes A semantic connection between objects of one or more classes In UML, represented as a line connecting two or more class boxes (or connecting one class to itself) In UML, represented as a line connecting two or more class boxes (or connecting one class to itself) Labeled with verb phrases Labeled with verb phrases A relationship is generally described by its name, degree, and multiplicity (minimum and maximum cardinality) A relationship is generally described by its name, degree, and multiplicity (minimum and maximum cardinality)
18
This is a binary relationship, which indicates that an employee works in a department.
19
Roles identify the purpose of each class in the relationship.
20
What Is Relationship Degree? The number of classes that participate in a relationship The number of classes that participate in a relationship Main degrees: Main degrees: –Unary – a relationship between objects of the same class (also called recursive) –Binary – a relationship between objects of two different classes (most common) –Ternary – a relationship between objects of three different classes
22
Quantity is the amount of a particular Part shipped from a particular Vendor to a particular Warehouse
23
What Is Relationship Multiplicity? The range of the number of objects in Class A that can or must be associated with each object of Class B. The range of the number of objects in Class A that can or must be associated with each object of Class B. A multiplicity is made up of: A multiplicity is made up of: –A minimum cardinality – the minimum number of Class A objects possible –A maximum cardinality – the maximum number of Class A objects possible
24
Relationship Multiplicity Relationships can be: Relationships can be: –One – to – one –One – to – many –Many – to – many
25
Multiplicity notation is: min..max Store stocks more than 1 videotape of a movie 1 instructor teaches 0-6 sections
26
Roles make it clearer to see which should be on the one side and which should be on the many side of the relationship. 0-1 supervisor manages 0 to many subordinates
27
What Is an Associative Class? A special purpose class that represents an association (relationship) between classes and contains attributes and/or relationships in its own right A special purpose class that represents an association (relationship) between classes and contains attributes and/or relationships in its own right A many-to-many association that is modeled as a separate class A many-to-many association that is modeled as a separate class Represented as a class connected to an association with a dotted line Represented as a class connected to an association with a dotted line
28
A Certificate represents a relationship between an employee and a course, and has an attribute pertaining to that relationship (dateCompleted)
29
Sometimes associative classes have their own relationships with other classes.
30
Types of Associations Association – no object is subordinate to any other. Association – no object is subordinate to any other. Aggregation – one class represents the whole, and the other represents the part, but it is a loose coupling. Aggregation – one class represents the whole, and the other represents the part, but it is a loose coupling. Composition – an aggregation with a tight coupling. The whole and the part cannot exist without each other. Composition – an aggregation with a tight coupling. The whole and the part cannot exist without each other.
31
The wholeThe part Course registration needs at least 1 course and vice versa
32
What Is Generalization? A superclass – subclass relationship in which one class forms a broader category in which the other class is a sub-category A superclass – subclass relationship in which one class forms a broader category in which the other class is a sub-category Inheritance – A subclass will inherit all the attributes and operations of its superclass; an instance of the subclass contains all the same information (plus more) as an instance of the superclass. Inheritance – A subclass will inherit all the attributes and operations of its superclass; an instance of the subclass contains all the same information (plus more) as an instance of the superclass.
35
Multiple inheritance is complicated and not supported by all object- oriented programming languages.
36
Any Questions?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.