Uml Class Diagram Inheritance. In uml 2 5 properties inherited by a classifier from a superclass may be shown on a diagram of the inheriting classifier by prepending a caret symbol to the textual representation of the inherited property. Both freight and passenger class have the data and methods of train journey and they also have their own unique data and methods.
Realization denotes the implementation of the functionality defined in one class by another class. When we implement generalization in a programming language it is often called inheritance instead. The terminology just differs depending on the context where it is being used.
Class diagrams are used for a wide variety of purposes including both conceptual domain modeling and detailed design modeling.
Generalization and inheritance are the same. Classes their attributes operations or methods and the relationships among objects. Example below shows patient class with inherited attributes title name and birthdate with prepended caret symbol. Uml 2 class diagrams show the classes of the system their interrelationships including inheritance aggregation and association and the operations and attributes of the classes.