The Bitter Coder Tutorials, Binsor Style: Injecting Service Arrays

Mon, Oct 6, 2008 One-minute read

Previous posts in the series:

So, in keeping with my shameless plagirizing of Alex’s code, here is the abstract class for our new calculators:

component “total.calculatornodec”, AbstractCalculator,TotalCalculator

component “gst.calculatornodec”, AbstractCalculator, GSTCostCalculatorNoDecorator:     GstRate=Convert.ToDecimal(1.20)

component “shipping.calculatornodec”, AbstractCalculator, ShippingCalculatorNoDecorator:     FragileShippingPremium=Convert.ToDecimal(0.0) Just like we did in our post on arrays, we inject an array of dependencies.  Changing the order is just a matter of switching the order in the binsor.  All good.

Running the program gives the same output as the last post.

Next post, which is the last in the series until Alex writes more (whew), is on the “Startable” facility.