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!

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.