February 15, 200917 yr Evening folks, I have been using PHP for a number of years and have gradually built up my skills by learning things such as OOP to a pretty high standard. I am looking into building quite a large scale PHP application but am not sure where to start. I have all the skills, just not sure what design pattern to use. I have built applications in the past but as they have gradually become larger and larger, they have become complicated and confusing due to the maze of links and files and have eventually become unmanageable. If you were to build a large application for example an intranet system for 50+ users featuring bulletin boards, payment trackers, bulletins etc using OOP techniques, in what way would you lay out the code for it to be as logical and modulated as possible. I am planning on using .htaccess to run everything through an index.php file which will then route to the correct methods for the task. I have looked into design patterns such as the MVC (Model-View-Controller) pattern but this seems far too complicated and pointless for what I am planning to build. Any ideas appreciated. Regards, Dan
February 15, 200917 yr No no no! I am a very advanced PHP / MySQL programmer. Start with a Core class, don't extend it at all. Call the class Main or Program. Embed all your constants in the Program class and use them like so: Program::const_name Also, your program class will instanciate all nessecary classes with a foreach loop using the "autoload" magic function. Then, have a collection of classes that each do a seperate thing. Have a good heirachy of files and if a file is to do something then use it as so, eg. /core/dosomething.php You CAN use index.php and use the switch statement, however there are major security holes in doing it that way.
Create an account or sign in to comment