April 19, 200917 yr I have a real problem with processing requests. I am designing an Intranet and website for work. Its a small company so the two projects will give me a lot of experience. However, I have a stumbling block of how to process page requests. For example, to create a new project I would have one request to view the form to input details and another request to process the data on that form, for example project.php?request=create to display the form and project.php?request=processcreate to sort out the data on the form. However, how do I process these in terms of layout and structure? I have come up with the following: - A massive switch statement that direct requests to class functions. This is impractical and hard to maintain. - A series of switch statements in various files that direct requests to class functions. Fairly similar to the above but easier because files can be split into various groups according to what purpose they serve. - A completely class based system, going through a hierarchy of classes, but based on smaller switch statements within class constructors. This is the one I'm thinking of using at the moment. Everything will have one entry point, which will parse the request and pass to the appropriate class constructor. E.g. if the first part of the request contains "project" the project class constructor is called, which then parses other elements in the request and applies the appropriate action. To me this idea is simpler to edit than scrolling through a massive switch statement. I just don't know how to handle the varying requests and have no experience in designing something of this magnitude, although I'll be fine with coding. I'd like to use classes as thats what I'm familiar with from C# and C++. All suggestions are welcome.
April 26, 200917 yr Author Have you thought about running with an open source CMS system? I would rather not. The whole point of the exercise is to make my own and gain experience from it. However, could you recommend any open source systems that I could use to get some ideas from?
Create an account or sign in to comment