I have this component, Price, with way too much redundant, conditional branching (based on $productType) in just about all it’s functions.
I suppose I could create different price components, one for each $product type, and just do one switch() in my main controller to decide which component to call, but that requires a switch() in my main controller, which I’m not crazy about. The OO approach would be to define an abstract class with different implementation subclasses. I suppose I could brute force include() it via bootstrap, then do all the instantiation myself. That's so raw php'ish though. Basically I need a factory pattern, but am not sure of the best way to integrate it into a cake app. Any suggestions? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
