RE: Comments on my code Design...

From: Date: Thu, 22 Jun 2000 01:10:07 +0000
Subject: RE: Comments on my code Design...
Groups: php.general 
Request: Send a blank email to php-general+get-2561@lists.php.net to get a copy of this message
---------------------------------------------------------------------------- ----------------- Disclaimer: The information contained in this email is intended only for the use of the person(s) to whom it is addressed and may be confidential or contain legally privileged information. If you are not the intended recipient you are hereby notified that any perusal, use, distribution, copying or disclosure is strictly prohibited. If you have received this email in error please immediately advise us by return email at postmaster@normandy.com.au and delete the email document without making a copy. ---------------------------------------------------------------------------- ----------------- Matthew, Why bother writing your own DB connectivity and session wrapper? Check out PHPLib (phplib.netuse.de i think) it should do everything you want (well with regards to those two things). -----Original Message----- From: Matthew M. Boulter [mailto:mboulter@uq.net.au] Sent: Wednesday, June 21, 2000 11:40 PM To: PHP-General (List) Subject: Comments on my code Design... ** bear with the length thanx ** G'day all, I'm new to PHP (2wks now) coming in from C++. My department has given me the specs to a website that I have till July 10 to do, *fun!*. So I was wanting your input on the design plan behind the modules, please expliot my 'newbie-ness' to PHP and flame the logic ;) Essentially the site is for student to come in and check their personal details, and the information for subjects (desc, class list, timetable (this is static)...). We have several types of users: students (check/change their details, link to subject pgs, ...) teachers (primarily just edit their class list) graduates (restricted browsing to certain pages that students can access) administrator (add/edit/delete above 3 user types) * The student information is stored as a MySQL database. Okay so this is all straight-forward, however I don't have the time to get this wrong, and therefore my logic can't be flawed from the beginning. Here's my plan: Classes - cStudent, cTeacher, cAlumni, cAdmin :parent: cUserBaseObj Classes for each user type, all derived from a common parent class. dbMySQL Database connectivity wrapper. cSession Session Management wrapper. Operation - - User attempts to access any page (in case of bookmarking). - Display Authenticate dialog box - Instantiate the Dbase Object, and check user - Return validity, and if valid what type of user (Student, Teacher...) - Check that they're allowed to access requested page, if not redirect them - Query the dbase as the page requires - Display requested page, filled with lovely database-derived content, *sweeet* My questions are - * Since the user object is required on every page they jump around to (they'll be moving between pages a fair bit), should I use Session stuff here, or default to global variables to maintain the data? This same question for the dbMySQL object. * General design thoughts - any comments/suggestions would be great. --- Thanx in advance for any help guys, Cheers, -------------------------------------------------------------------------- Matthew M. Boulter email: mboulter@uq.net.au Conceptua Media Developments mobile: 0414-912-501 (for the University of Queensland) --------------------------------------------------------------------------

« previous php.general (#2561) next »