in reply to 'Variable' sub names
If products were objects, you could define a class for each type of product and call a single method on each object. With the individual classes, you could override the method to do the appropriate thing for the product type.
(This is the Replace Conditional with Polymorphism refactoring. It's one of my favorites.)
|
|---|