Fix bugs, clean the code and add unit tests.
This commit is contained in:
35
simple-factory/etc/simple-factory.urm.puml
Normal file
35
simple-factory/etc/simple-factory.urm.puml
Normal file
@@ -0,0 +1,35 @@
|
||||
@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
|
Reference in New Issue
Block a user