Relationships between two classes – Class Coupling in OOP

Posted by admin on February 6, 2008 under Programming | Comments are off for this article

Class Relationships

  • Class A inherits from Class B.
  • Class A has an attribute of class B.
  • Computer

  • Class A has a template attribute with a parameter of class B.
  • Class A has a method with an argument of class B.
  • Class A knows of a global variable of class B.
  • Class A knows of a method containing a local variable of class B
  • Class A is friend of Class B (in C++)

UML specifies the following six relationships between two classes:

  1. Association
  2. Aggregation
  3. Composition
  4. Inheritance
  5. Dependency
  6. Realization

Comments are closed.