A picture of Tom Pears

Cyber Home of Tom Pears

Applying Appropriate Technology to Learning

My OOP challenge

Imagine a pin board where sellers are invited to post notices. A viewer can look at the entire board where they see all the notices but only a few of the fields. A viewer can choose from a list of categories and see only the notices in that category. A viewer can click on one notice and see all the public fields for that one notice. Within this single notice mode, a viewer can use a Next and Previous button.

Anyone can open a form to create a notice. Once they have filled in the fields, they click a See Notice As It Will Display button. If any of the fields are invalid, they are returned to the create a notice form with proper error message. Once validation is complete, the creator is offered the chance to Submit For Public View. Once a notice has been Submitted, there is no re-edit functionality. A creator would have to write a new notice from scratch.

There is an Admin function with a hidden URL. Anyone coming to the admin URL page is asked for name and password credentials. Once successfully logged in, the admin is presented with the same All or sub category view that the Viewer sees. There are additional sub categories of Post, NoPost, New. Once the admin has clicked on one notice, the admin has complete ability to edit any field including an admin one that is either Post or NoPost. The admin can change anything and click the same See Notice As It Will Display button. All fields are validated and redisplayed with a Submit button. Pushing the submit button takes the admin to the next notice in the previous view. Each admin page has a logout button that closes the admin function and returns the admin to the admin login page.


How do I attack the above design specification from an object oriented point of view?

The pin board functionality described above lives within a parent web site. There are Classes with Methods that display content within the web site framework. Within a php file, I will call the methods that display the page, then display the content specific to this file and then call methods to finish displaying the page.

Each notice is a line in a table in a MySQL database. There is a class with methods that access that table. The methods deliver one or more notices based on multiple criteria. There is a method that creates a new notice line. There is a method that changes one or more fields in a notice line.

There is a method that displays an empty notice form. There is a method that does validity checking on each field of the notice form. Those methods return an ok or an error message. There is a method that displays a filled in notice form with any error messages.

There is a class and methods that support a login system. There is a method that displays a login page. There is a method that validates username and password and sets a secession variable?