RopeADope Posted May 16, 2011 Share Posted May 16, 2011 Hi all. I'm starting a mini-project with the purpose of creating PHP generated charts. I just had a quick question on the class structure that I should use. My instinct tells me to do it like this: class chart{ function pie(){ } function bar(){ } } Is that a legitimate structure or is there a better way to do this? Link to comment https://forums.phpfreaks.com/topic/236541-oophp-class-structure/ Share on other sites More sharing options...
JasonLewis Posted May 16, 2011 Share Posted May 16, 2011 What are you trying to achieve exactly? What you've posted isn't really much, and it's perfectly valid and fine. Bit more information could be useful. Link to comment https://forums.phpfreaks.com/topic/236541-oophp-class-structure/#findComment-1216019 Share on other sites More sharing options...
RopeADope Posted May 16, 2011 Author Share Posted May 16, 2011 Just trying to figure out the what the framework would look like basically. I wasn't sure if each chart type should have its own class or if a parent chart class was acceptable. Link to comment https://forums.phpfreaks.com/topic/236541-oophp-class-structure/#findComment-1216022 Share on other sites More sharing options...
JasonLewis Posted May 16, 2011 Share Posted May 16, 2011 It would make more sense for you to do it this way. That way if there are any methods that both of your pie() and bar() methods share it'll be a lot cleaner. Link to comment https://forums.phpfreaks.com/topic/236541-oophp-class-structure/#findComment-1216026 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.