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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.