5g. UML Elements - InterfaceRealization
We just finished talking about Interfaces, so let's talk about how to implement them. For that let's talk about the "InterfaceRealization" relationship.
What is an InterfaceRealization?
"An InterfaceRealization relationship between a BehavioredClassifier and an Interface implies that the BehavioredClassifier conforms to the contract specified by the Interface by supporting the set of Features owned by the Interface, and any of its parent Interfaces."
InterfaceRealizations are a type of relationship that connects Classes to Interfaces. They specify that a Class "implements" or "realizes" that Interface and has the attributes and operations of the Interface. What this means is that instances of that Class can be treated as if they were an instance of the Interface (if Interfaces could be instantiated). Checking whether the Class is an instance or a type of the Interface should yield a true result.
A InterfaceRealization is shown in a Class Diagram as an arrow with a dashed line and an open arrowhead pointing from the direction of the Class toward the general Interface.

InterfaceRealization "implementingClassifier" and "contract"
A InterfaceRealization is also very simple. It only specifies an "implementingClassifier" Class and a "contract" Interface.
Comparison to Object-Oriented Programming Languages
An InterfaceRealization can be compared to the "implements" keyword, by the ":" operator in Class names, and by parenthesis "()" in other languages.
As in many Object-Oriented Langauges, UML allows one Class to "implement" or "realize" multiple Interfaces.
How do you know when to define a new InterfaceRealization?
This answer is fairly simple. Whenever you want a Class to "implement" or "realize" an Interface, you simply create an InterfaceRealization from the Class to the Interface.
Abstract Syntax
To illustrate what an InterfaceRealization is, UML provides abstract syntax which we have recreated in UML Class Diagrams.


