Hi People:
I have been programming crappy C++ games for years and now I want to try to create my own php strategy game but I'm having problems with the code organization.
The main problem is how to deal with the OOP using PHP. I know everything about the sintax but I dont know how to organize the source, ¿which is the best way to instantiate diferent objects to avoid making the same querys to the database on every user action?.
I know how to use sessions but is it a great idea to store the objects in the session?
Can I create static instances that shares the content between users? or I need to use the DB?
And what about the concurrency? If I store lots of data on the user session then If another user makes something maybe the user session gets deprecated and I need to update it just querying the DB, how to deal with that? maybe a events pool?
Any suggestion will be apreciated.
|