Inheritance Inheritance relationship defines a parent child relationship in which child is said to be type of parent. Child inherits common actions and attributes from parent. Inheritance relationship allows rich abstractions to reduce code repetition and to increase code reuse. Consider the Passenger and StudentPassenger objects. StudentPassenger object is of type Passenger. StudentPassenger inherits all actions and attributes of Passenger. Additionally a StudentPassenger has a pass card and pays less than a normal Passenger. It is phrased as StudentPassenger is a Passenger . Association Association is a relationship in which one object uses another object to achieve some task. They don’t own each other and their lifecycle is independent of each other. Consider the relationship between bus and bus station. They don’t own each other and they exists regardless of each other. It is phrased as Bus uses a Bus Stop to pick passengers. Aggregation Aggregat...
Software Engineering experiences and best practices