ClanKiller.com https://forums.plasmasky.com/ |
|
PHP OOP best practices https://forums.plasmasky.com/viewtopic.php?f=24&t=1503 |
Page 1 of 1 |
Author: | Satis [ Tue Nov 01, 2005 10:45 am ] | |||||||||
Post subject: | PHP OOP best practices | |||||||||
ok, so, this is mainly for Pig, but anyone else can jump in. ![]() I'm playing with OOP (object oriented programming for you poor schmucks out there). I'm curious as to some best practices. I'm building a user authentication class, mainly for code portability reasons. Any time I build user authentication into an app, is roughly the same. Minor improvements each time, of course, but blah. Anyway, I was wondering...what's the best way to do that? Should I build everything right into the __construct method, or should I break it out across several public functions? Also, would I be better off just lumping everything inline into a single public function, or breaking the thing off into separate private functions? I'm guessing the second part is really more about ease-of-coding more than anything else. I just can't think of a reason for not sticking everything into the __construct method. Here's what I've got so far for perusal. Maybe Gfree will have input too. It's not complete, but should be pretty obvious where I'm going. I'm just missing the actual authentication portion.
for the auth portion, I plan on checking $this->result, so if it's -1 (invalid db) it'll just die. Anyway, any input? Best practices? |
Author: | derf [ Tue Nov 01, 2005 11:23 am ] |
Post subject: | |
Aw man, I would've been able to give you OOP advice in the form of Java had i not dropped OOP this year. Im just not a programmer. |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |