jalena
Uploaded by
10 SLIDES
239 VUES
100LIKES

Practical Session 2 Class Design

DESCRIPTION

This practical session explores the fundamentals of UML Class Diagrams, focusing on the Class design of a Car and Shape hierarchies. We delve into specific components such as attributes (like engineSize and maxSpeed) and methods (including drive and getMaxSpeed). Additionally, the relationships between classes are illustrated with examples showing composition and inheritance. The session also covers interface implementation and the differences between abstract and non-abstract methods, providing a comprehensive understanding of UML and its application in object-oriented design.

1 / 10

Télécharger la présentation

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
SlideServe
Audio
Live Player
Audio Wave
Play slide audio to activate visualizer