1 / 10

Object-Oriented Design and Class Diagrams

Object-Oriented Design and Class Diagrams. OO Design. Planning the components (classes) necessary for a system Determine: the classes that will be defined their roles and relationships (and interaction) with each other Modeling. Why Go Through Design?.

gryta
Download Presentation

Object-Oriented Design and Class Diagrams

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. Object-Oriented DesignandClass Diagrams

  2. OO Design • Planning the components (classes) necessary for a system • Determine: • the classes that will be defined • their roles and relationships (and interaction) with each other • Modeling

  3. Why Go Through Design? • Modeling a system before implementing (coding) saves time and increases the chances of success • Can worry less about programming details • The design model serves as a coordination point between programmers in a team

  4. Modeling Techniques • Notation • The UML: Unified Modeling Language • The Standard for OO Systems • Diagramming Techniques in the UML • Class Diagrams • Use Cases • Interaction Diagrams • Others

  5. Class Diagrams • What is Depicted? • Classes • name, attributes, methods • rectangles • Relationships • inheritance, composition, association • links

  6. Classes in a Class Diagram • Class name only Example • With Details Example Ledger Class Name Ledger double balance post() sortByDate() Class Name attributes methods

  7. Relationships • Inheritance (arrow) • example: between Secretary and Employee • Composition/Aggregation (diamond) • example: between Car and Wheel • Association (line) • example: between Borrower and Book

  8. Inheritance Employee public class Secretary extends Employee { … } Secretary

  9. Composition Car Wheel 4 w[] public class Car { Wheel w[]; ... public Wheel() { w = new Wheel[4]; … } ... }

  10. Association Borrower Book 1 3 currBorr bk[] public class Borrower { Book bk[]; … public Borrower() { bk = new Book[3]; } } public class Book { Borrower currBorr; … }

More Related