170 likes | 228 Views
Object-Oriented Design Notation. CS 123/CS 231. References. Main Reference: UML Distilled, by Martin Fowler Chapters 3, 4, 6, and 8 Supplementary References: Chapter 14 of Sommerville Chapter 22 of Pressman. Component Design and Detailed Design. Component Design
E N D
Object-OrientedDesign Notation CS 123/CS 231
References • Main Reference: UML Distilled, by Martin Fowler • Chapters 3, 4, 6, and 8 • Supplementary References: • Chapter 14 of Sommerville • Chapter 22 of Pressman
Component Design and Detailed Design • Component Design • For each subsystem determine components, and services/interface per component • OO Design: components are classes • Detailed Design • Determine attributes of classes and relationships between the classes • Determine functionality of each class and interactions between classes
Object-Oriented Modeling • UML: Unified Modeling Language • OO Modeling Standard • Booch, Jacobson, Rumbaugh • What is depicted? • Class details and static relationships • System functionality • Object interaction • State transition within an object
Some UML Modeling Techniques • Class Diagrams • Use Cases/Use Case Diagrams • Interaction Diagrams • State Diagrams
Example:Class Diagram FastFoodCounter totalcash totalorders PriceChecker getPrice() pc counters 5 FastFood (Restaurant)
Example:Use Case Diagram LIBRARY SYSTEM Facilitate Checkout Search for Book Borrower Librarian Facilitate Return
Example:Interaction Diagram 2: checkIfAvailable() Checkout Screen :Book 1: checkIfDelinquent() 3: borrowBook() 4: setBorrower() :Borrower
Example:State Diagram (Book) start Reserved Borrowed New Librarian activates book as available Borrower returns book Available
Object-Oriented Design Models • Static Model • Class Diagrams • Dynamic Model • Use Cases, Interaction Diagrams, State Diagrams, others
OO Static Model • Classes and Class Diagrams • Relationships • Association • Aggregation/Composition • Inheritance • Dependencies • Attribute and Method names
OO Dynamic Model • Goal: Represent • Object behavior • Object interaction • Traditional/Procedural Dynamic Modeling • Data Flow Diagrams (DFDs) • Problem: Processes separate from data • Need modeling notation that highlight tight relationship between data & processes
DFD Example(Inventory Management) Accept and Post Delivery Delivery info Transaction Item Master
OO Counterpart:Object Interaction new (delivery info) Encoder :Transaction post (item count) :Item Master
Building anOO Dynamic Model • Identify use cases • Describe each use case through an interaction diagram • For more complex objects, provide a state diagram per class • Derive implied methods (and attributes)
What’s Next? • Need to understand the notation • Make sure it helps the software development process • When to use the UML techniques • Primarily when specifying OO design • Formal means of communication across the different software development stages