1 / 25

Structured Design and Modeling

Structured Design and Modeling. CS 123/CS 231. Design Models Revisited. UML: Modeling Language for OO Systems For the Procedural (Structured) Paradigm Data and processes are separately considered Data Model: Entity-Relationship Diagram Process Model: Data-Flow Diagram

ila-richard
Télécharger la présentation

Structured Design and Modeling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Structured Designand Modeling CS 123/CS 231

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

  3. ERDs • Entity-Relationship Diagrams • Used to produce a datamodel for an enterprise • Database Design

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

  5. Relationships • Relationship • an association between (at least) two entities • examples: student borrows a book • Cardinality • One-to-one, one-to-many, many-to-many • Intersection Data • attribute resulting from relationship • example: date-borrowed

  6. The Notation • Rectangles - Entities • Ellipses - Attributes • Diamonds - Relationships • Links • Labels

  7. Example: The University Setting • Description • Students enroll in classes. Each class is a section of a particular course. • Entities • Student, Section, Course

  8. address name year id number qca Student

  9. room index sched M M Student enrolls Section M grade 1 Course has cat num desc title

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

  11. M M Student borrows Book

  12. M M Student borrows Copy M 1 Book has Exercise: Complete Diagram by filling in attributes

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

  14. From ERD to Tables • Create a table for each entity • attributes associated to entity are columns of the table (a primary key should exist per table) • For 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 • For each 1:1 relationship • add primary key of one table plus intersection data to the other table • For each M:M relationship • create a new table • attributes are the primary keys of the participants plus intersection data

  16. University Setting Example • Student • id number, name, address, year, qca • Section • index, room, sched, cat num • Course • cat num, title, desc • Enroll • id number, index, grade

  17. DFDs • Data Flow Diagrams • Models Operations (Processes) • Also used in analysis and design

  18. Processes • An operation or function in a system • example: Borrow Book • Involves • 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 • Circle (Bubble) - Process • Arrows - Data Flows • Rectangles - Sources and Sinks • Labels

  20. 1 Borrow Book id num, copy num borrow confirmation Student Borrow Copy

  21. DFD Levels • A process may involve sub-processes • provides detail about the process • DFD levels emerge • Process hierarchy also depicted using a structure chart

  22. 1.1 Check Student Status id num borrower status Student 1.2 Check Book Copy Status copy num copy status Copy

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

  24. About DFDs • Data flows should “balance” between levels • Number label format X.X.X provides level information • Context Diagram • Level 0 (or system-level) DFD • Notational Variations

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

More Related