Presentation is loading. Please wait.

Presentation is loading. Please wait.

Z556: Session 8 Data Modeling

Similar presentations


Presentation on theme: "Z556: Session 8 Data Modeling"— Presentation transcript:

1 Z556: Session 8 Data Modeling
Entity-Relationship Diagram (ER). Unified Modeling Language (UML).

2 Modeling Cultural Model Flow Model Physical Model Artifact Model
Sequence Model E-R Diagram

3 What is Data Modeling? A process for identifying, documenting & organizing data elements based on specified requirements. It’s imp to know that Data modeling is not the beginning of the design process. There are previous steps that need to be done before data modeling. You need to understand the problem, learn the current situation, identify the needs of the users, and identify the requirements for the systems. When you do that, you work on identifying the data elements that matter to solve the problem, and use modeling to document these elements and organize them to best serve your situation. 3

4 A design activity that is not limited to data analysis. (Be Creative…)
What is Data Modeling? A design activity that is not limited to data analysis. (Be Creative…) You need to know that data modeling is a design activity that is not limited to data analysis. Therefore, there can be many accepted solutions and designs that serve your purpose. The decision of which design to implement depends on many factors, some of which are not at all related to the structure of the system. And because it is a design activity, you can be creative, think outside of the box, show your unique touch in the design 4

5 Can be presented in many different ways.
What is Data Modeling? Can be presented in many different ways. E.g., Tables Entity-Relationship diagram Class diagram Activity diagram And because data modeling is a design activity, there many ways to document and organize the data elements. 5

6 Why Data Modeling? To identify essential data elements and understand their role in supporting business processes. Data modeling is used as a plan for developing applications, specifically how data is stored and accessed. 6

7 A Little Incentive to Pay Attention
Annual Mean Salary by Job Financial specialist $74,270 Information and Record Clerks $32,320 Loan officer $71,800 Network & Computer Systems administrator $77,910 Paralegals $51,170 Database administrator $80,740 Advertising Sales Agents $57,440 Actuaries $107,740 Bureau of Labor Statistics

8 Data Modeling Language
Entity-Relationship (ER) Diagram Object-Oriented (OO) Design Unified Modeling Language (UML) 8

9 Case Study: KCCI Training Center
KCCI training center organizes training programs for customers in three different areas: Investment, Real-Estate, & Human-Resources. For each program to run, there is a required minimum number of attendees. To enroll in a program or more, a customer fills a registration form and send it to the center. A training coordinator keeps track of the number of registered customers. When the minimum number is reached before the start date of the program, the coordinator contacts a trainer to run the program and then sends confirmation/invoice letters to the customers. If no trainer is available or the minimum number is not reached, cancelation letters are sent to the customers. One of the best way to learn a new language is to see how it is used. So, this is an example of a real life case study. Kuwait Chamber of Commerce and Industry (KCCI)

10 Case Study: KCCI Training Center
Problems: Ineffective paper-based system that fails to meet the growing trends of the center. Difficulty to track programs and participants. Difficulty to locate misplaced or lost files. Difficulty to share and access information. Underutilized data for future planning.

11 Case Study: KCCI Training Center
Solution: Develop a new information system for managing, storing, retrieving, and analyzing all information related to training programs. Purpose of data modeling: To identify essential data elements and understand their role in supporting work processes.

12 ER Diagram Entity Relationship Attribute
The principle data objects about which information is to be collected E.g., person, place, document, etc. Entity instance: a particular occurrence of an entity. What are the entities in the Training Center? Instances Indiana University Bloomington University of Indianapolis University of Phoenix Entity name University

13 ER Diagram Entity Relationship Attribute
Real-word association among entities. Entity Entity Relationship Manager Department Manages

14 ER Diagram Entity Relationship Attribute
Connectivity of a relationship : Describes the constraints on the connection of the associated instance in the relationship. A department has only one manager  a manager governs only one department A department has many employees  an employee works in one department A project involves many employees  an employee works on many projects. In addition, you can express connectivity in terms of maximum or minimum. Which one of these do you think is the most used and which one is the least used in data modeling? Entity 1 Relationship 1 Entity Entity 1 Relationship * Entity Entity * Relationship * Entity

15 ER Diagram Entity Relationship Attribute
Provides descriptive detail about entities and relationships. An attribute value: a particular occurrence of an attribute within an entity or relationship. Each entity has a key attribute used to uniquely determine an instance of an entity. What type of connectivity in this relationship (enroll)? Many-to-many. How can we solve this problem? Create weak entity “Registration form”. Section ID date enroll name Student Class Title

16 KCCI ER Diagram Coordinator * * * Customer * * Program * Trainer Name
CoID Name is-contacted-by 1 Coordinator 1 contacts 1 Manages Address Date * * * is given by Customer * enrolls * Program * 1 Trainer ProgID Name Name CustID TrnID Area Title Phone

17 KCCI ER Diagram Coordinator * * * Customer * * Program * Trainer Name
CoID Name is-contacted-by 1 Coordinator 1 contacts 1 Manage Address Date * * * is given by Customer * enrolls * Program * 1 Trainer ProgID Name Name CustID TrnID Area Title Phone

18 KCCI ER Diagram Coordinator * * * Customer * * Program * Trainer
CoID Name is-contacted-by 1 Coordinator 1 contacts 1 Manage Address Date * * * is given by Customer 1 * Registration Form * 1 Program * 1 Trainer ProgID Name Name CustID TrnID Area Title Phone

19 Implementing Entity (Customer) Cust# Name Address Phone # 100
Peter Alex 335 10th Entity (Customer)

20 Implementing Attribute (address) Entity Cust# Name Address Phone # 100
Peter Alex 335 10th data instance Entity

21 Many-to-Many Relationship
Cust_id F_name L_name address 1234 Mary Gray 456 Oak street 1235 Bill Dodds 789 Woodburn street 1236 Justin Moore 903 College avenue Registration Class_id Price Date Class name 135 100 Oct Customer Service 101 136 200 Nov Types of Investment 137 Oct Property Evaluation

22 Many-to-Many Relationship
CUSTOMER Cust_id F_name L_name Address REGISTRATION Registration_id Cust_id Class_id 0088 1234 136 PRODUCT Class_id Price Date Class name

23 Generalization Hierarchy Diagram
Entities with common attributes can be generalized into a higher entity type (Superset entity). Subsets entities can be either disjoint (d) or overlapping (o). ER diagram also supports the creation of a hierarchy diagram. Disjoint: instance in one set cannot appear in another subset Overlapping: an instance in one subset can appear in another subset. 23

24 Hierarchy Diagram d Overlap (o) Generalization
Disjoint (d) Generalization Name StartDate Phone ProgID PerID EndDate Program Person d o Human-Resources Customer Trainer Real-Estate Investment Coordinator

25 Object-Oriented (OO) Design
Objects are the basic unit which the organization must keep track of or that participate in a business process. A system is a set of objects that collaborate and interact with each other. UML is a widely accepted standard incorporating OO concepts, and provides terminology and diagram conventions. UML is a language used to communicate between stakeholders and developers. Language are best learned by practice. What are the objects in the training center? Similar to ER entities. 25

26 Object-Oriented Design
Properties attached to each object. Attributes: Functions that could change the value of object’s attribute. Operations : Procedure used to carry on the operations. Methods: What makes Object-Oriented model different from ER is that 3 types of information are associated with an object: 26

27 OO Concepts Classes: Categories to which an object belong to and share the same operation, methods, and attributes. Class Name Attribute 1 Attribute 2 Attribute 3 Operation 1 () Operation 2 () Operation 3 () Customer CustomerID Name Address SearchProgram() Enroll () Pay () Classes are categories to which an object belong to and share the same operation, methods, and attributes, but might not share the same attribute value. Operations can include arguments to specify type of information or default value of the operation. 27

28 Class Relationships in UML
Generalization: A relationship between a more general class and a more specific class. Association: Objects in one class linked to objects in the other class. Multiplicities: 1 to 1 , 1 to * , * to * Program Real-Estate Investment Human-Resources Each object in the specific class is indirect object in the general class. Specific class inherits the features of the general class. 28 Coordinator Program

29 Class Relationships in UML
Aggregation: Relationship between a whole and its parts. Composition: An aggregation relation in which the part belong to only one whole at a time. Trainer Program A part may belong to more than one whole. ProgramDescripton Program Purpose TargetAudience 29

30 UML Class Diagram (Attributes)
1..1 1..* 1..* 1..* Trainer <pk>TrainerID Name PlaceOfWork Phone Fax Note Program <pk>ProgramID Title TrainingArea Location StartDate EndDate StartTime EndTime Cost MinAttendees Coordinator Status Note Customer <pk>CustomerID Title Name Phone Fax Work Note 1..1 1..1 RegistrationForm <pk>RegFormID Date <pk>CustomerID <pk>ProgramID Note 1..1 1..* Association Class 1..1 Invoice <pk>InvoiceID Date RegistrationForm Cost Note 1..1 Coordinator <pk>CoordinatorID Name Phone Note

31 UML Class Diagram (Operation)
1..1 1..* 1..* 1..* Trainer AddTrainer() RemoveTrainer() isAvailable(:Boolean) Program AddProg () ConfirmProg () CancelProg() Customer NewCust() SignIn() FindProgram() Enroll(in enrl: Program) SendRegForm() Payment() 1..1 1..1 1..* RegistrationForm AddProgram() RemoveProgram() AddCustomer() RemoveCustomer() 1..1 Coordinator ProgStatus () ConfirmLetter () CanelLetter () ContactTrainer() Class diagrams provide the same opportunity to document data and their relationships as ER, but it also can captures operations. An operation could have a parameter value placed between the parentheses "( )". The parameters can specify expected input or output data from each operation. 1..1 1..1 Invoice Total (amnt: Dollar)

32 Summary Data modeling help identify essential data elements and understand their role in supporting business processes. Data modeling simplifies communication between system developers and end users. Data modeling supports the development of information systems. 32

33 Develop a Data Model for Choosing a Job?
What are the entities/classes? What are the attributes? What are the relationships? Entities: Person(name, , phone, CV), Job(title, salary, responsibilities, requirements, contactPerson), Organization (name, location, type, website) 33

34 Develop a Data Model for Choosing a Job?
1..1 1..* 1..* 1..1 ContactPerson <pk>CP_ID Name Phone Fax Note Job <pk>JobID <pk>CP_ID <pk>OrgID Title Salary Responsibilities Requirements StartDate Location Note Organization <pk>OrgID Name Phone Fax Website Type Note Entities: Person(name, , phone, CV), Job(title, salary, responsibilities, requirements, contactPerson), Organization (name, location, type, website) 34

35 The 7 Habits of Highly Effective Data Modelers (Moody, 1996)
Knowledge Skill Motivation Habit Moody, D. (1996) The seven habits of highly effective data modelers. Database Programming & Design, 9, 10,

36 The 7 Habits of Highly Effective Data Modelers (Moody, 1996)
See for yourself (observation—Method school of data modeling) Generate alternatives Keep it simple (generalization) Test the model (prototyping/scenario) Know when to stop Remember the big picture Following through Contextual Inquiry

37 Object-Orientation Objects An object has attributes and operations
Color; Size ILS Z556

38 Object-Orientation Objects An object has attributes and operations
Make a call ILS Z556

39 Object-Orientation A class is a category to which an object belongs
E.g., Smartphone is a class for Nexus and iPhone; both share the same attributes and operations ILS Z556

40 Object-Orientation Window is a class that has:
Attributes of: size, location, background color, etc. ILS Z556

41 Object-Orientation Window is a class that has:
Operations of: open, close, resize, etc. ILS Z556

42 UML and ER UML class diagrams =~ ER diagrams Classes =~ Entities
Attribute 1 Class Name Attribute 1 Attribute 2 Operation 1() Operation 2() Entity Name

43 UML and ER UML class diagrams =~ ER diagrams Classes =~ Entities
Example Class Name Attribute 1 Attribute 2 Operation 1() Operation 2() Customer <pk>Customer_id: string Customer_name: string Address: string creditRating ()

44 UML and ER UML class diagrams =~ ER diagrams Classes =~ Entities
Example Class Name Attribute 1 Attribute 2 Operation 1() Operation 2() Customer <pk>Customer_id: string Customer_name: string Address: string creditRating () Create Read Update Delete

45 UML: Class Diagram Customer Order association Payment aggregation
date status name address 1 0..* calcTax calcTotal calcTotalWeight association Payment 1 1 1..* amount aggregation 1..* line item OrderDetail specialization quantity taxStatus Credit Cash Check calcSubTotal calcWeight number type expDate cashTendered name bankID authorized authorized


Download ppt "Z556: Session 8 Data Modeling"

Similar presentations


Ads by Google