Best approach.. Objects worthwhile?
Posted: Sun Nov 08, 2009 5:59 am
I know this is my first post here, and I'm sorry that its asking rather than offering. Here it is anyway though. Thanks for your help.
I'm making an application, in all my experience with php(which isn't really all that much), I haven't used objects but once(and that was a very basic usage). For this application, which is primarily the backend for a facebook application, I've been writing a ton of functions, in ajax and php both( a ton == about 20 or so). Most of them are only run once, but some are run repetitively (about 10-50 times per session). Almost all of the functions are for Ajax Requests and database queries. Everything loads up into the primary page, with only one box loading content(and a status div that gets its innerHTML updated [for debugging mostly]).
I'm loading about 20k in files onload (not counting prototype[~180k total]).
Each request currently connects to the db. ( Worth using mysql_pconnect()? )
My question is primarily about efficiency, but there's a couple other ones.
Is it going to be a big (beneficial) difference in server load to switch it to objects?
Should I make an object/function to perform all of the requests dynamically?
Is there an all-in-one regex string that can make sure there isn't any xss submitted?
Thank you for your experienced opinions.
-Ri
I'm making an application, in all my experience with php(which isn't really all that much), I haven't used objects but once(and that was a very basic usage). For this application, which is primarily the backend for a facebook application, I've been writing a ton of functions, in ajax and php both( a ton == about 20 or so). Most of them are only run once, but some are run repetitively (about 10-50 times per session). Almost all of the functions are for Ajax Requests and database queries. Everything loads up into the primary page, with only one box loading content(and a status div that gets its innerHTML updated [for debugging mostly]).
I'm loading about 20k in files onload (not counting prototype[~180k total]).
Each request currently connects to the db. ( Worth using mysql_pconnect()? )
My question is primarily about efficiency, but there's a couple other ones.
Is it going to be a big (beneficial) difference in server load to switch it to objects?
Should I make an object/function to perform all of the requests dynamically?
Is there an all-in-one regex string that can make sure there isn't any xss submitted?
Thank you for your experienced opinions.
-Ri