Removing the evaluation article code.
This commit is contained in:
parent
bacef5cfa2
commit
ee3acb502b
|
@ -1,10 +0,0 @@
|
|||
package com.baeldung.hexagon;
|
||||
|
||||
public class ConstantTaxRateRepository implements TaxRateRepository {
|
||||
private static final double TAX_RATE = 0.13d;
|
||||
|
||||
@Override
|
||||
public double getRate() {
|
||||
return TAX_RATE;
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.baeldung.hexagon;
|
||||
|
||||
public class TaxCalculator implements TaxService {
|
||||
|
||||
private TaxRateRepository taxRateRepository;
|
||||
|
||||
public TaxCalculator(TaxRateRepository repository) {
|
||||
super();
|
||||
taxRateRepository = repository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double calculateTax(double amount) {
|
||||
return amount * taxRateRepository.getRate();
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.baeldung.hexagon;
|
||||
|
||||
public class TaxFactory {
|
||||
public static TaxService getTaxService() {
|
||||
return new TaxCalculator(getTaxRepository());
|
||||
}
|
||||
|
||||
public static TaxRateRepository getTaxRepository() {
|
||||
return new ConstantTaxRateRepository();
|
||||
}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package com.baeldung.hexagon;
|
||||
|
||||
public interface TaxRateRepository {
|
||||
public double getRate();
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package com.baeldung.hexagon;
|
||||
|
||||
public interface TaxService {
|
||||
public double calculateTax(double amount);
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package com.baeldung.hexagon;
|
||||
|
||||
public class TestTaxUser {
|
||||
|
||||
public double calculateTax(Double amount) {
|
||||
return TaxFactory.getTaxService()
|
||||
.calculateTax(amount);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue