![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Hi, I'm looking to develop a web-site with both database and php access. Personally I'm familiar with the MVC design pattern , are there any quick pointers on other suitable patterns, that will cover both web & database? | |||
|
| Advertisements |
| | #2 | ||
| This doesn't get to your question in an abstract way because I am just learning the concept of patterns, and may not get to it at all, but it is my experience with structuring php scripts. I've been coding for acouple of years, off and on, because of a need to have an interactive web application for a project I am involved in. I suspect that while I have used various scripting structures, they all more or less fall under the the MVC model. I started out trying to keep pages organized into several categories: those that are mostly html, includes that provide libraries of functions and, my goal, one script that handles all the processing. This latter involved a lot of switches and other control structures to get the data processed appropriately. This pretty much followed the MVC pattern, the html pages being the view and the processing script being the control. I designed my database, I guess you would call this the M part, based on a conceptual analysis of my project needs and some guidelines from "Database Design for Mere Mortals," which I found to be a very useful book. Over time, I found my processing script growing to a size that it was hard to manage. I faced more and more challenges regarding how to send my html data to the right parts of the script. What I finally resolved to, which serves me pretty well now, is a model where the script that processes an html page is placed between php tags at the head of the document. The html on that page, which I try to keep as pure html as possible, is placed "below" the script tags and any action it triggers refers back to the same page, activiting a switch or some control mechanism to process the data appropriately. Once the data is processed, the user is sent to the same or another html page as appropriate, sending along any necessary data in post, get or session variables. I'm finding myself modfiying my database schema as we use the application and as I see how it interacts with my scripting needs. Thus it is being modified to adapt to practical scripting issues and to the end use requirements. In this way I provide increased flexibility and efficiency all all levels. As my scripts develop, I find ways to reuse them and re-organize them so that they are growing into modules and more readable scripts. This seems to be a useful development model for me, though it may not work for an enterprise sized application or a design project involving a team of developers. I am not doing OOP, though I am looking into it. I'm not sure there are advantages for the size of the project I am involved in. I use my functions and includes in a similar way to which one might use objects and have thought about experimenting with developing them into objects. I'm very interested in other responses to your query. --Kenoli On May 17, 2:27 pm, anal_aviator <analavia...@pornolizer.com> wrote: > Hi, > I'm looking to develop a web-site with both database and php access. > Personally I'm familiar with the MVC design pattern , are there any quick > pointers on other suitable patterns, that will cover both web & database? | |||
|
| | #3 | ||
| On Sat, 19 May 2007 02:33:05 +0800, kenoli wrote (in article <1179513185.241010.75350@k79g2000hse.googlegroups. com>): > This doesn't get to your question in an abstract way because I am just > learning the concept of patterns, and may not get to it at all, but it > is my experience with structuring php scripts. I've been coding for > acouple of years, off and on, because of a need to have an interactive > web application for a project I am involved in. I suspect that while > I have used various scripting structures, they all more or less fall > under the the MVC model. > > I started out trying to keep pages organized into several categories: > those that are mostly html, includes that provide libraries of > functions and, my goal, one script that handles all the processing. > This latter involved a lot of switches and other control structures to > get the data processed appropriately. This pretty much followed the > MVC pattern, the html pages being the view and the processing script > being the control. I designed my database, I guess you would call > this the M part, based on a conceptual analysis of my project needs > and some guidelines from "Database Design for Mere Mortals," which I > found to be a very useful book. > > Over time, I found my processing script growing to a size that it was > hard to manage. I faced more and more challenges regarding how to > send my html data to the right parts of the script. What I finally > resolved to, which serves me pretty well now, is a model where the > script that processes an html page is placed between php tags at the > head of the document. The html on that page, which I try to keep as > pure html as possible, is placed "below" the script tags and any > action it triggers refers back to the same page, activiting a switch > or some control mechanism to process the data appropriately. Once the > data is processed, the user is sent to the same or another html page > as appropriate, sending along any necessary data in post, get or > session variables. > > I'm finding myself modfiying my database schema as we use the > application and as I see how it interacts with my scripting needs. > Thus it is being modified to adapt to practical scripting issues and > to the end use requirements. In this way I provide increased > flexibility and efficiency all all levels. > > As my scripts develop, I find ways to reuse them and re-organize them > so that they are growing into modules and more readable scripts. > > This seems to be a useful development model for me, though it may not > work for an enterprise sized application or a design project involving > a team of developers. > > I am not doing OOP, though I am looking into it. I'm not sure there > are advantages for the size of the project I am involved in. I use my > functions and includes in a similar way to which one might use objects > and have thought about experimenting with developing them into > objects. > > I'm very interested in other responses to your query. > > --Kenoli > > On May 17, 2:27 pm, anal_aviator <analavia...@pornolizer.com> wrote: >> Hi, >> I'm looking to develop a web-site with both database and php access. >> Personally I'm familiar with the MVC design pattern , are there any quick >> pointers on other suitable patterns, that will cover both web & database? > > Yes thanks for the reply. As you point out other responses will be interesting. I was looking for people not using the MVC , basically to get an idea of what they were doing as regards the web project and any experiences they had. I was also looking at the Observer Design pattern, however it appears some patterns Can be applied globally to a site , whereas others specifically target given areas. | |||
|
| Featured Websites | ||||
|
![]() |
| Tags: design, patterns, php, web |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Web Design/SEO Partnership | slwebsolutions | Search Engine Optimization | 1 | 09-24-2006 7:46 PM |
| Dynamic Web Design:: PHP Vs ASP: | colin | Website Coding | 0 | 07-30-2006 4:52 PM |
| Game Design | Halo | Gaming Questions | 1 | 07-05-2006 5:32 PM |
| Featured Websites | ||||
|