Architecture of very complex php applications?

I want to know which php architecture strategy developers use in complex php applications. So far, I know the mvc framework, which consists of models, views, and a controller (and controller plugins that handle common tasks, such as user access controllers). I know some good php frameworks that make some simple things easier. But the problem starts when I talk about huge and complex php applications. because in these applications there are many things that need to be done, or I think a lot to check, so I can not decide which code should be where.

Think of the magento app, it is a very simple app. when I look at the source code of the application, I cannot understand the design strategy. I know that there are several perfect development strategies that can easily handle very large php applications because they cannot create 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 summarize, I want how I can create larger applications. Now the design strategies that I use in my applications are limiting me, so I cannot create more complex applications. I want to know which development strategy can handle complex applications.

I know this is a very abstract question, but this is because now my php background comes from an amateur hobby not from an academic one. I want to do more, but I'm somewhere where I cannot go one step further, because I cannot find more complex information about coding. anything to summarize, I want to know about design strategies for complex php applications like magento.

Perhaps the design strategies I know (mvc, frameworks ci cake ...) can handle more complex applications than I think.

If there are some errors in my questions, do not hesitate to correct them, sorry for my inadequate English.

+6
design oop php design-patterns model-view-controller
source share
7 answers

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

I highly recommend that you familiarize yourself with Martin Fowler's enterprise application architecture patterns. This is the main job for any other books that you can later pick up that cover the same concepts in a language-specific format, and if you want to really understand what it takes to create reliable, scalable applications on the Internet, then need to familiarize yourself with this book.

Currently, a very common and popular design strategy with web applications is the Model-View-Controller paradigm. This must be done completely with separation of problems in your application so that you do not mix the database access code with the html output.

For a very good attitude to this topic, I would suggest that you look here (the specific Zend Framework, but it describes the general topic well) and here to discuss models in particular. Or, if you want to take a look at a more general PHP MVC tutorial, Rasmus Lerdorf has one .

In addition to this (and again you can learn it from PofEAA by Martin Fowler) you will need to learn about object-relational comparisons of what strengths and weaknesses different design patterns have.

Unfortunately, there are many good ways to do something depending on your needs, but for each good way, there are about twenty terrible wrong ways to do it.

+7
source share

What framework have you learned? Explore symfony, Zend Framework, and CakePHP if you haven't already. And by researching, I mean actually writing medium-sized applications using this framework. Just reading the code is often not enough to understand how it works. You often have to use it and try to change it.

You can also check out the PHP 5 Object Patterns and Practice book for some ideas on design strategies that you can apply to your expression. You can also learn a little by studying frameworks written in other languages. For example, the designers of many PHP frameworks were heavily inspired by Ruby on Rails.

+2
source share

This is indeed a very abstract question, and "very complex" is not very specific. When I hear people talking about β€œcomplex” applications, I associate them with

a) Someone uses complex architecture for a simple task. For example. using every design template and frames that sound cool.

b) Someone tried to topple tons of a completely different usecase into a historically developed application, creating and using proprietary and undocumented interfaces and connecting everything as closely as possible. Unfortunately, CAN can create huge applications with poor design strategies, and this makes them complex.

c) Deprecated systems and legacy system integration (ok see b)

Magento may be a great application, but the underlying platform is still the Zend Framework , mostly part of MVC. Therefore, reading the Zend_Framework documentation will also help you understand the Magentos architecture (I will not recommend it the other way around, trying to delve into the Zend Framework through the Magento source). I would recommend actually starting to create a larger application with one of the MVC frameworks on your own, because this is the best way to learn the architecture and its advantages and where it is limited.

+1
source share

If you have not done so already, you should learn about object-oriented programming. There is a really great tutorial about it here . I think that this is perhaps the most important thing that large web applications do, which are not necessarily intuitive for the amateur (including me). The trick in MVC infrastructures like Code Igniter is to create a series of classes (or objects) as models or libraries.

+1
source share

Well, even if your question is only about PHP ... If you process your static content, such as images from PHP, this will lead to poor performance regardless of whether you use MVC or not. For such things, you should use a front end like nginx.

Check out http://highscalability.com/ real life stories!

Also pay attention to NoSQL.

0
source share
0
source share

I tried to understand your problem and found that the magento architecture is very powerful, but complex. I got a solution from Zendfox , it’s a web application framework suitable for developing small or large size applications. It has a very pretty application architecture that can be run very easily. He also has module developers for creating custom modules for zendfox in a few minutes based on the wizard.

So take a look at: http://www.zendfox.com

0
source share

All Articles