java-design-patterns/simple-factory/etc/simple-factory.urm.puml
2020-09-02 18:12:42 +01:00

35 lines
736 B
Plaintext

@startuml
package com.iluwatar.simplefactory {
class App {
- LOGGER : Logger {static}
+ App()
+ main(args : String[]) {static}
}
interface Car {
+ getDescription() : String {abstract}
}
class CarSimpleFactory {
+ CarSimpleFactory()
+ getCar(type : CarType) : Car {static}
}
~enum CarType {
+ FERRARI {static}
+ FORD {static}
+ valueOf(name : String) : CarType {static}
+ values() : CarType[] {static}
}
class Ferrari {
~ DESCRIPTION : String {static}
+ Ferrari()
+ getDescription() : String
}
class Ford {
~ DESCRIPTION : String {static}
+ Ford()
+ getDescription() : String
}
}
CarType ..+ CarSimpleFactory
Ferrari ..|> Car
Ford ..|> Car
@enduml