I've been trying to wrap my head around OOP for the last several hours but i'm having a hard time breaking my self of old coding habbits. :o
So here's my question... I guess I just want to make sure I understand this correctly. I create a class and in this class would be all my functions and variables that have to do with that class.
So for example, a user authentication system would be something like:
<?php
class user_authentication {
// Class Variables
var $username
var $email
// Create User Account
function create_account() {
// Some Code
}
function validate_username() {
// Some Code
}
function validate_password() {
// Some Code
}
function validate_email() {
// Some Code
}
}
?>
... and so on.
Would it be better to create one class that does the account regitration (password check, email validation, etc) and another that does the actuall authentication (loggin in, etc)? All in the same class?
I guess I'm just looking for any tips on how to go about designing an OOP based app. I've read a lot of the other threads on the board, and I think i'm on the right track but would like to see what the gurus think...
Thanks!