1 / 12

Class diagrams

Class diagrams. Terézia Mézešová. Class diagram. static diagram, part of UML describing classes structure of system shows classes, their attributes and methods and relationships between classes classes represent main interactions in system and classes to be programmed. Classes. name

havily
Télécharger la présentation

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. Class diagrams Terézia Mézešová

  2. Class diagram • static diagram, part of UML describing classes structure of system • shows classes, their attributes and methods and relationships between classes • classes represent main interactions in system and classes to be programmed

  3. Classes • name • attributes • methods • abstract classes have name in italics

  4. Attribute and method syntax • visibility name : data_type • visibility name ( parameter_name : parameter_type, ... ) • visibility: • +   public • -    private • #   protected • /   derived • _   static

  5. Relationships class level: • generalization • realization instance level: • association • aggregation • composition

  6. Generalization • "is a" relationship, inheritance • instance of subtype is also instance of superclass

  7. Realization • one element realizes the behavior of second element • e.g. relationship between classes and interfaces showing that the class realizes methods offered by the interface

  8. Association • represents static relationship between objects of two classes

  9. Aggregation • "has a" relationship • type of association relationship • can only involve two classes

  10. Composition • "owns a" relationship • stronger than aggregation • if the container class is destroyed, all contained classes must be destroyed as well

  11. Other types of relationships • dependency - one class uses another at some point • multiplicity: • 0..1 - no or one instance • 1 - exactly one instance • 0..* - zero or more instances • 1..* - at least one or more instances

  12. Thank you for your attention

More Related