@Override public double calculateTaxFactorFor(Person person) { if (POLAND.equalsIgnoreCase(person.getCountryName())) { return POLAND_TAX_FACTOR; } return DEFAULT_TAX_FACTOR; }
public double processTaxFactorFor(Person person) { try { double taxFactor = taxService.calculateTaxFactorFor(person); taxService.updateTaxData(taxFactor, person); return taxFactor; } catch (Exception e) { System.err.printf( "Exception [%s] occurred while trying to calculate tax factor for person [%s]%n", e, person.getName()); return INVALID_TAX_FACTOR; } }
@Override public void updateTaxData(double taxFactor, Person person) { System.out.printf( "Calling web service with tax factor [%s]to update person [%s] tax data%n", taxFactor, person.getName()); }