fwegan Posted June 21, 2007 Share Posted June 21, 2007 So I've read the tutorials, bought a book, and created a few test classes (they even worked!). I've got the basic OOP stuff down, I think, but I'm struggling with the design for my current project. I need to create a management system for a non-profit website, complete with different levels of user access, publishing tools for the "static" pages, and management of about a dozen MySQL tables for email lists, calendars, etc. I've done a system a lot like this procedurally before, but all the copy-pasting is insane. So here's what the outline looks like now: User class to handle login/out and user privileges One class per MySQL table for calendars and email lists and published pages Page class that checks login, prints the markup for menus and submenus, and puts the whole page together I'd love to hear how people have done this sort of thing before, or how you would do it. Any advice would be much appreciated! Quote Link to comment Share on other sites More sharing options...
Jenk Posted June 25, 2007 Share Posted June 25, 2007 First rule of OO.. don't reinvent the wheel. There are literally thousand's of CMS applications to choose from. That aside, you are looking at your class structure wrong. Classes (and thus objects) are there as objects of behaviour. You would hae one class for database accessing, another possibly for the result sets returned, and so forth. Not "one for this table, one for that table, etc." You can use a TableDataGateway (see Design Patterns) object, which you can use, but it is not explicity a "Table of data" it is simply, as the name suggests, a gateway for fetching data from that table - it will have a child consisting of the DataSource accessor (object) 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.