Slashdot Mirror


Elegant PHP Architectures?

akweboa164 asks: "I work as a lone developer creating small to medium scale PHP/MySQL websites for different clients. I have been doing this for about two years now, and have tried different things as far as website layout/architecture goes. With sites that use the fusebox architecture, front controller (thanks J2EE), N-tier, to having a simple 'include(config.php);' line at the top of every file, I am left with the feeling that all of the sites I have created are 50% elegance, and 50% nasty kludge. I am left with a sinking feeling because I know that they could be better, but I lack to expertise and experience to make them that way. I am looking for overall architecture that is open and fits within the constraints of PHP (ie. relying little on OO) and separates logic, makes updates easy, etc. I wanted to ask Slashdot's crowd of web developers what their most elegant code layout/design web solutions were, and what advice would you dish out to new developers, as well as seasoned professionals."

1 of 118 comments (clear)

  1. Java View/Model/Controller by Ann+Coulter · · Score: 0, Offtopic

    I have always favored Java's architecture. It is a very organized and powerful solution. By combining Java with MySQL, one can implement the View/Model/Controller design pattern in a web site. The Java applet and web documents will function as the View whereas MySQL implements the Model and the Controller will be the interface code for MySQL. Using Java in this way will lead to solid code akin to Apple.