Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Architecture of very complex php applications?

I want to know which php architecture strategies developers use in complex php applications . So far , i know the mvc structure which consists of models, views and controller (and controller plugins which handle with common tasks such as user access controller ). I know some good php frameworks which makes some common stuffs easier .But the problem starts when i thing about huge and complex php applications . because in these applications there are lots of stuff to do or lots of think to check, so i can not decide which code should be where .

Think about magento application , this is very huge application . when i review the source code of application , i can not understand the design strategy . i know there are some perfect design strategies which can handle very big php applications easily , because they can not build such a huge application with a very weak design strategy .the design strategy should support more than you want , so you can improve your code and application easily

To sum up , i want to how can i create bigger applications . Now the design strategies i use in my applications limits me , so i can not create more complex applications . i want to know which the design strategy can handle complex applications.

i know this is very abstract question , but this is because now my php background coming from amateur hobby not from academic . i want to do more , but i am in somewhere where i can not go one step more , because i can not find more complex info about coding . whatever ,to sum up , i want to know about design strategies for complex php applications such as magento .

Maybe the design strategies which i know (mvc , frameworks ci cake ...)can handle more complex applications than i think ..

if there are some mistakes in my questions please feel free to correct them , sorry for my inadequate english ..

like image 289
Oguz Bilgic Avatar asked Nov 18 '09 16:11

Oguz Bilgic


People also ask

What is the architecture of PHP?

PHP itself is basically one executable which reads in a source code file of PHP code and interprets/executes the commands written in that file. That's it. That's PHP's architecture in a nutshell.

What is the best architecture for web applications?

It's called stateless architecture. This is the most efficient and reliable web application model. The reason is that both servers and databases have multiple substitutions. So, in case of failure, there are two way-outs: to store data in all the accessible databases or distribute it evenly among them.

What architectural styles are most commonly used to describe enterprise web based applications?

Layered architecture patterns are found in many e-commerce web applications and desktop applications. It is also useful for applications that need to be built quickly and for enterprise applications that need to adopt traditional IT processes.


2 Answers

I believe that part of your problem may lie in the fact that creating enterprise applications is a problem in any language, and the design patterns that can implemented are actually language agnostic.

I would strongly recommend that you familiarize yourself with Patterns of Enterprise Application Architecture by Martin Fowler. This is the seminal work for any other books that you may later pick up that cover the same concepts in a language specific format, and if you want to truly understand what is required to create robust, scalable applications on the web then you'll need to familiarize yourself with this book.

A very common and popular design strategy with web applications right now is the Model-View-Controller paradigm. This has to do completely with separation of concerns in your application so that you aren't mingling database access code with html output.

For a pretty good treatment of the topic I would suggest that you look here (Zend Framework specific but it covers the general topic well) and here for a discussion about Models specifically. Or if you want to look at a more generalized PHP MVC tutorial, Rasmus Lerdorf has one.

In addition to this (and again you can learn this from PofEAA by Martin Fowler) you will need to learn about Object-Relational-Mapping what the strengths and weaknesses are of the various design patterns.

Unfortunately there are many good ways to do things depending on your needs, but for every good way there are about a zillion horribly wrong ways to them.

like image 57
Noah Goodrich Avatar answered Oct 02 '22 05:10

Noah Goodrich


Which frameworks have you examined? Examine symfony, Zend Framework, and CakePHP if you haven't already. And by examine, I mean actually write medium-sized applications using these frameworks. Simply reading code is often not enough to get a grasp of how it works. You often have to actually use it and try to modify it.

You may also want to check out the book PHP 5 Objects Patterns and Practice for some ideas of design strategies that you may apply to your application. You may also learn quite a bit by studying frameworks written in other languages. The designers of many of the PHP frameworks were heavily inspired by Ruby on Rails, for example.

like image 45
jkndrkn Avatar answered Oct 02 '22 06:10

jkndrkn