Ok, i'd like to firstly make you notice that i have looked for "php mvc design patterns" and so and i haven't really found what i was looking for; still now, writing my question, i cannot find any related and so specific question as i am going to ask. But i know i'm probably wrong, anyway consider this question and a question pack that could be usefull togheter.
Question
Gang of Four
or someone who actually know what he is talking about) mvc tutorial or documentation related to php?Tips
I'd prefer free solution first. I don't like frameworks, so please don't refer to them even if (i know) they have mvc and other valid design patterns and benefits. I still don't like them. Thanks
Notice
I'll choose my accepted answer after tomorrow, so, please, take your time to answer.
What are they?
Design patterns are language-agnostic blueprint solutions for common problems. They are not downloadable code or readymade implementations, but a theoretical approach you can implement/translate into working solutions.
Design Patterns also allow for easier communication between developers who know patterns, because when developer A says: this is a Factory, developer B will know what is meant.
Where could i find a list about every design patterns on the web? Or at least the 5-10 most used design patterns?
There is also a recommendable book called PHP Design Patterns (german only) for which you can download the code samples at http://www.phpdesignpatterns.de/auflage-2/#beispiele
Do phpbb, wordpress or joomla (that i know pretty well) use a design pattern? If yes, then which?
Probably, but listing each and every pattern an application uses is rather pointless. Some patterns are tiny, some are more complex. You dont use them to use them, but to solve problems.
Let me stress that: you dont use them to use them. They are not some sort of status symbol. You dont want to amass them. You even don't have to implement them by the book. Use them where appropriate with every variation required to solve a concrete problem in your application.
I googled MCV PHP and found about 3 italian articles and read about 5 of the first pages ranked and i didn't understand pretty much nothing. They were conflicting and seemed to me confusing. I did understand that it is usefull to separate business login, script and view (?) but i didn't got anything.
MVC is not a GOF pattern. It is listed in POEAA but it's way older than that. The MVC you usually see on the web has nothing to do with the "classic" MVC because there is the internet between view and the other two.
Basically, there is not much to know about MVC. It's very simple pattern. The idea is to split a UI into three distinct roles. The model is all your business logic. Your controller handles any requests from the view and delegates to the model. Your view displays the model. You should be able to replace the controller and views without having to touch your model.
Are there simple examples about design patterns and how they are better then (normal) writing styles?
Plenty. See the links above for some examples. If they are not clear enough, have a look around StackOverflow searching for their names.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With