Jump to content

First OOP project -- content management system


fwegan

Recommended Posts

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!

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)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.