Skip to content

Instantly share code, notes, and snippets.

@theboreddev
Created July 5, 2020 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theboreddev/0014da1a7faee6c37d0a8eeb13a54592 to your computer and use it in GitHub Desktop.
Save theboreddev/0014da1a7faee6c37d0a8eeb13a54592 to your computer and use it in GitHub Desktop.
oldstrategy
final PriceCalculatorFactory factory = new PriceCalculatorFactory();
final Item newItem = new Item(1L, new BigDecimal("12.99"));
final DeliveryPriceCalculator priceCalculator = factory.priceCalculatorFor(OldStylePlan.BASIC);
System.out.println("Delivery price is " + priceCalculator.priceFor(newItem));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment