36 lines
936 B
Plaintext
36 lines
936 B
Plaintext
|
@startuml
|
||
|
package com.iluwatar.separatedinterface {
|
||
|
class App {
|
||
|
- LOGGER : Logger {static}
|
||
|
+ PRODUCT_COST : double {static}
|
||
|
+ App()
|
||
|
+ main(args : String[]) {static}
|
||
|
}
|
||
|
}
|
||
|
package com.iluwatar.separatedinterface.taxes {
|
||
|
class DomesticTax {
|
||
|
+ TAX_PERCENTAGE : double {static}
|
||
|
+ DomesticTax()
|
||
|
+ calculate(amount : double) : double
|
||
|
}
|
||
|
class ForeignTax {
|
||
|
+ TAX_PERCENTAGE : double {static}
|
||
|
+ ForeignTax()
|
||
|
+ calculate(amount : double) : double
|
||
|
}
|
||
|
}
|
||
|
package com.iluwatar.separatedinterface.invoice {
|
||
|
class InvoiceGenerator {
|
||
|
- amount : double
|
||
|
- taxCalculator : TaxCalculator
|
||
|
+ InvoiceGenerator(amount : double, taxCalculator : TaxCalculator)
|
||
|
+ getAmountWithTax() : double
|
||
|
}
|
||
|
interface TaxCalculator {
|
||
|
+ calculate(double) : double {abstract}
|
||
|
}
|
||
|
}
|
||
|
InvoiceGenerator --> "-taxCalculator" TaxCalculator
|
||
|
DomesticTax ..|> TaxCalculator
|
||
|
ForeignTax ..|> TaxCalculator
|
||
|
@enduml
|