Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Order
- {
- // ...
- public double Price()
- {
- return new PriceCalculator(this).Compute();
- }
- }
- public class PriceCalculator
- {
- private double primaryBasePrice;
- private double secondaryBasePrice;
- private double tertiaryBasePrice;
- public PriceCalculator(Order order)
- {
- // Copy relevant information from the
- // order object.
- }
- public double Compute()
- {
- // Perform long computation.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement