Home / cs-notes / Design / Design Patterns / Creational Patterns / Simple Factory
@startuml
class Client {
}
class SimpleFactory {
+ createProduct(): Product
}
interface Product {
}
class ProductA {
}
class ProductB {
}
Client ..> SimpleFactory
Client ..> Product
SimpleFactory .> Product
SimpleFactory ..> ProductA
SimpleFactory ..> ProductB
Product <|.. ProductA
Product <|.. ProductB
@enduml