@startuml

package shapes {
    interface Shape {
        + {abstract} draw(): void
    }

    class Circle {
        .. Override ..
        + draw(): void
    }

    class Square {
        .. Override ..
        + draw(): void
    }

    class Rectangle {
        .. Override ..
        + draw(): void
    }

    Shape <|.. Circle
    Shape <|.. Square
    Shape <|.. Rectangle
}

class ShapeFactory {
    + getShape(): Shape
}

shapes <-- ShapeFactory : 创建工厂

class Client {
    + {static} main(): void
}

ShapeFactory <-- Client : 使用工厂


@enduml
