Oguz Bilgic
Oguz Bilgic

Reputation: 3480

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 that handle common tasks such as user access controller ). I know some good php frameworks which makes some common stuff easier. But the problem starts when I think about huge and complex php applications. because in these applications there are lots of stuff to do or lots of things to check, so I can not decide which code should be where.

Think about the Magento application, this is a very huge application. when I review the source code of the application, I can not understand the design strategy. I know some perfect design strategies 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 limit me, so I can not create more complex applications. I want to know which design 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 an academic. I want to do more, but I am somewhere where I can not go one step further 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 that 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.

Upvotes: 5

Views: 5282

Answers (6)

Ram
Ram

Reputation: 26

I tried to understand your problem and found that magento architecture is very powerfull but complicated. I got a solution by Zendfox, It is a web application framework, suitable for small to huge application development. It has very cute application architecture that can be manage very easily. It also has module developer to create custom modules for zendfox within few minutes wizard based tool.

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

Upvotes: 0

Ilya Khaprov
Ilya Khaprov

Reputation: 2524

Well, even if your question just all about PHP... If you handle your static content like images with PHP it will result poor performance no matter using you MVC or not. You should use front end like nginx for such things.

look at http://highscalability.com/ real stories from real life!

Also note NoSQL.

Upvotes: 0

Brandon Jackson
Brandon Jackson

Reputation: 775

If you haven't already, you should look into Object-Oriented Programming. There is a really great tutorial about that here. I think this is perhaps the most important thing that big web apps do that isn't necessarily intuitive to the amateur (myself included). The trick in MVC frameworks like Code Igniter is to build a series of classes (or objects) as either models or libraries.

Upvotes: 1

Noah Goodrich
Noah Goodrich

Reputation: 25263

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.

Upvotes: 7

jkndrkn
jkndrkn

Reputation: 4062

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.

Upvotes: 2

Daff
Daff

Reputation: 44205

It is indeed very abstract question and "very complex" is not very specific. When I hear people talking about "complex" applications I associate it with

a) Someone is using a complex architecture for a simple Problem. E.g. by using every design pattern and framework that sounded cool.

b) Someone tried to squish tons of entirely different usecase into a historically grown application, creating and using proprietary and undocumented interfaces and couple everything as tightly together as possible. Unfortunately CAN build huge applications with a bad design strategy and that is what makes them complex.

c) Legacy systems and Legacy System integration (ok see b)

Magento may be a big application, but the underlying Framework is still the Zend Framework, mainly its MVC part. So reading the Zend_Framework documentation will help you a lot to understand Magentos architecture as well (I won't recommend it the other way around by trying to dig into the Zend Framework through the Magento source). I would recommend to actually start building a bigger application with one of the MVC frameworks yourself, because that is the best way to learn the architecture and its benefits and where the limits are.

Upvotes: 1

Related Questions