Presentation is loading. Please wait.

Presentation is loading. Please wait.

Structured Design and Modeling CS 123/CS 231. Design Models Revisited zUML: Modeling Language for OO Systems zFor the Procedural (Structured) Paradigm.

Similar presentations


Presentation on theme: "Structured Design and Modeling CS 123/CS 231. Design Models Revisited zUML: Modeling Language for OO Systems zFor the Procedural (Structured) Paradigm."— Presentation transcript:

1 Structured Design and Modeling CS 123/CS 231

2 Design Models Revisited zUML: Modeling Language for OO Systems zFor the Procedural (Structured) Paradigm ÕData and processes are separately considered ÕData Model: Entity-Relationship Diagram ÕProcess Model: Data-Flow Diagram zSome modeling techniques apply to both paradigms Õe.g., use case diagram and state diagrams

3 ERDs zEntity-Relationship Diagrams zUsed to produce a data model for an enterprise zDatabase Design

4 Entities and Attributes zEntity Õthing, person, place Õexamples: Book, Sales Invoice, Student, Customer, Employee, Department, Airport zAttribute Õfeature of an entity Õexamples: Name, Address, Age, QCA, Title, Author, Amount, City

5 Relationships zRelationship Õan association between (at least) two entities Õexamples: student borrows a book zCardinality ÕOne-to-one, one-to-many, many-to-many zIntersection Data Õattribute resulting from relationship Õexample: date-borrowed

6 The Notation zRectangles - Entities zEllipses - Attributes zDiamonds - Relationships zLinks zLabels

7 Example: The University Setting zDescription ÕStudents enroll in classes. Each class is a section of a particular course. zEntities ÕStudent, Section, Course

8 Student id number name address year qca

9 StudentenrollsSection Coursehas MM M 1 grade index room sched cat num title desc

10 Example 2: Library zStudent borrows book Õmany to many relationship between students and books Õsee first diagram zFurther analysis reveals there could be several copies of a book Õstudent borrows copy, book has copy Õsee second diagram

11 StudentborrowsBook MM

12 StudentborrowsCopy Bookhas MM M 1 Exercise: Complete Diagram by filling in attributes

13 ERDs and the Software Life Cycle zUsed at the design phase of the software life cycle for database systems, although it is often used as early as the analysis phase zIn design, it precedes table definition

14 From ERD to Tables zCreate a table for each entity Õattributes associated to entity are columns of the table (a primary key should exist per table) zFor each 1:M relationship Õadd the primary key of the “1” participant as an attribute of the “M” participant (foreign key); intersection data is also added to the “M” participant

15 ERD to Tables, continued zFor each 1:1 relationship Õadd primary key of one table plus intersection data to the other table zFor each M:M relationship Õcreate a new table Õattributes are the primary keys of the participants plus intersection data

16 University Setting Example zStudent Õid number, name, address, year, qca zSection Õindex, room, sched, cat num zCourse Õcat num, title, desc zEnroll Õid number, index, grade

17 DFDs zData Flow Diagrams zModels Operations (Processes) zAlso used in analysis and design

18 Processes zAn operation or function in a system Õexample: Borrow Book zInvolves Õdata flow (input and results) Õdata sources and sinks Example: student and book-copy info are data that flow into the process; results stored in borrow table

19 Notation zCircle (Bubble) - Process zArrows - Data Flows zRectangles - Sources and Sinks zLabels

20 1 Borrow Book Student Copy Borrow id num, copy numborrow confirmation

21 DFD Levels zA process may involve sub-processes Õprovides detail about the process zDFD levels emerge zProcess hierarchy also depicted using a structure chart

22 1.1 Check Student Status id numborrower status copy numcopy status 1.2 Check Book Copy Status Student Copy

23 1.3 Record Borrow id num, copy num Borrow borrower status, copy status borrow confirmation Copy

24 About DFDs zData flows should “balance” between levels zNumber label format X.X.X provides level information zContext Diagram ÕLevel 0 (or system-level) DFD zNotational Variations

25 Summary zModeling techniques and notation Õneeded in analysis and design Õmodels data and processes of a system zOther techniques and notation Õstate diagrams, structure charts, flowcharts, document flow diagrams, more... zStructured vs OO Paradigm Õsome techniques specific to the paradigm


Download ppt "Structured Design and Modeling CS 123/CS 231. Design Models Revisited zUML: Modeling Language for OO Systems zFor the Procedural (Structured) Paradigm."

Similar presentations


Ads by Google