1 / 10

Practical Session 2 Class Design

Practical Session 2 Class Design. UML Basics UML - Unified Modeling Language. Class Diagram. Name Fields Methods. Car. - engineSize : int - maxSpeed : int. # getMaxSpeed() : int + drive(). Permissions notation : + public, - private, # protected. Relations. A. B.

jalena
Download Presentation

Practical Session 2 Class Design

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. Practical Session 2 Class Design

  2. UML BasicsUML - Unified Modeling Language

  3. Class Diagram Name Fields Methods Car - engineSize : int - maxSpeed : int # getMaxSpeed() : int + drive() Permissions notation: +public, - private, # protected.

  4. Relations A B A has an object of type B n C D C has a collection of objects of type D

  5. Relations example Car - engineSize : int - maxSpeed : int + drive() # getMaxSpeed() : int Wheel - airPressure: double + roll() 4

  6. Inheritance Base Car Derived Ferrari

  7. Interface Implementation Interface Vehicle Implementation Car

  8. Abstract Class Name* Fields Non Abstract Methods Abstract methods * Car * - engineSize : int - maxSpeed : int # getMaxSpeed() : int + drive() *

  9. Shape Hierarchy example

  10. ShapeBase * - canv : Canvas - offset : Point + draw() * + delete() * + move(p: Point) Shape draw() delete() move(p: Point) n Polygon Point Circle Triangle Rectangle Square

More Related