Presentation is loading. Please wait.

Presentation is loading. Please wait.

L3-S1 Practical Solutions 2003 SJSU -- CmpE Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering.

Similar presentations


Presentation on theme: "L3-S1 Practical Solutions 2003 SJSU -- CmpE Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering."— Presentation transcript:

1 L3-S1 Practical Solutions 2003 SJSU -- CmpE Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José State University One Washington Square San José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad

2 L3-S2 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad 2 Lesson 3: ERDs & Class Diagrams for 1. School 2. File System 3. Kitchen

3 L3-S3 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad Lesson Objectives 3 How to Create an ERD or Class Diagrams Business Rules School’s ERD or Class Diagram File System’s ERD or Class Diagram Kitchen’s ERD or Class Diagram

4 L3-S4 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad Write the business rules Create a model for each Business Rule Connect the resulted models based on the business rules Validate and test the ERD or the Class Diagram 4 How to Create an ERD or Class Diagram for Any Problem

5 L3-S5 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad A school has a principal, many students, and many teachers. Each of these persons has a name and a birthdate, and may borrow and return books. 5 School: Business Rules (1) Teacher salary StudentPrincipal evaluateTeacher() School Person salary birthdate 0..* Book title author loan return Borrows

6 L3-S6 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad Teachers and the principal are both paid a salary; the principal evaluates the teachers. A school board supervises multiple schools and can hire or fire the principle of each school. 6 School: Business Rules (2) School Board hirePrincipal() firePrincipal() School 0..*

7 L3-S7 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad A school has many playgrounds and rooms. A playground has many swings. Each room has many chairs and doors. Rooms include restrooms, classrooms, and the cafeteria. Each classroom has many computers and desks. Each disk has many rulers. 7 School: Business Rules (3)

8 L3-S8 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad 8 School: Business Rules (3) RestroomCafeteriaClassroom 0..* School RoomDoorChair 0..* Playground Swing ComputerDesk Ruler 0..*

9 L3-S9 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad A drive may have many multiple disks –A hard drive contains many disks. –A floppy drive contains one disk. Please note that: –A drive may exist without a disk –A disk may exist without a drive 9 File System: Business Rules (1)

10 L3-S10 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad A disk is divided into tracks which are in turn subdivided into sectors. Please note: Tracks are part of the disk and sectors are part of the track 10 File System: Business Rules (2)

11 L3-S11 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad A file system may spread on multiple disks and a disk may be partitioned across file systems. 11 File System: Business Rules (3)

12 L3-S12 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad Similarly a disk may contain many files and a file may be partitioned across many disks A file system consists of many files Each file has a filename, owner, permissions for reading and writing, last modifications date, size, checksum. Please note: Files are part of the file system. 12 File System: Business Rules (4)

13 L3-S13 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad Files may be data files and directory files A directory file is associated with a directory A file may correspond to many directories. Data file may be an ASCII file, executable file, or both. 13 File System: Business Rules (5)

14 L3-S14 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad 14 File System’s Class Diagram Would you be able to generate the file system’s class diagram?

15 L3-S15 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad A room is part of a building. A building has many rooms A kitchen is a kind of (AKO) a room Please not that a building is a whole and a room is a part. The rest of the business rules are very simple. Would you be able to generate the rest of the business rules and the class diagram? 15 Kitchen: Business Rules (1)

16 L3-S16 Practical Solutions 2003 SJSU – CmpE --- M.E. Fayad Any Question? 16 Discussion Questions


Download ppt "L3-S1 Practical Solutions 2003 SJSU -- CmpE Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering."

Similar presentations


Ads by Google