Search code examples
javaoopumlclass-diagram

Interface defined inside a class


How to indicate that an interface is a part of class? Let's take this case as an example.

public class Function
{
     public interface Function2D
     {
            double GetValue(double x);
     }

     ...

}

Talking more precisely - I need to show the relationship between Function and Function2D in an UML class diagram.


Solution

  • This UML Quick Reference gives an indication of how to represent an Inner class in a UML diagram:

    Inner Class diagram element