Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 12 - Inheritance and Polymorphism - Section 12.8 - Class Relationships - Check Point - MyProgrammingLab - Page 421: 12.17

Answer

The common types of relations among classes are: Association Aggregation Composition Inheritance Dependency

Work Step by Step

The common types of relationships among classes are: Association: This represents the relationship between two classes where one class uses the services provided by the other class. In UML, an association is represented by a solid line connecting two classes. Aggregation: This represents a "has-a" relationship between two classes, where one class has an instance of the other class. In UML, aggregation is represented by a diamond shape on the aggregate class and a solid line connecting the aggregate and part classes. Composition: This represents a strong "has-a" relationship between two classes, where the composite class owns and is responsible for the lifecycle of the part class. In UML, composition is represented by a filled diamond shape on the composite class and a solid line connecting the composite and part classes. Inheritance: This represents an "is-a" relationship between two classes, where one class inherits the attributes and behaviors of another class. In UML, inheritance is represented by an arrow pointing from the subclass to the superclass. Dependency: This represents a relationship where one class depends on another class for some of its functionality. In UML, a dependency is represented by a dotted line connecting two classes.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.