Hello everybody,
Can someone tell me the best book explaining Model-View-Contoller architecture?
Thanks in advance
Mohodn
| SitePoint Sponsor |




Hello everybody,
Can someone tell me the best book explaining Model-View-Contoller architecture?
Thanks in advance
Mohodn
Last edited by rageh; Apr 10, 2009 at 20:13.
------------------


MVC is a design pattern, an idea, a general guideline. It's not language specific and there's not a single way to do something MVC-like in PHP. If you want to learn it, read the description of the pattern online, and pick a PHP framework that's based on the MVC pattern, and look through some of their sample apps.
Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
It's not such a difficult subject that it would need its own book.
The best book on design patterns is this:
Design Patterns: Elements of Reusable Object-Oriented Software
Look for it on amazon.com
it will help you understand many design patterns.




Thanks Dan. I know it is not a language but rather a design pattern. There are many articles on the web about this. But their explanation find you wanting. Some of the articles are written by newbies. So they just leave you more confused than before. I have seen MVC application that is totally confusing the way they have written. So I don't want to follow any example. I want a good examples.
I want to get a good grap of the issue. Any example stuff more complex than the customary, I hasten to add stupid, "hello world" which is childish to begin with because nobody want to write that crap. I like a good application example that has all the intricacies of a web application.i.e login, registeration, database connectivity issues, session handling ans so on and so forth. I have seen the examples by the codeignite but I don't like Codeignite anyway. So I am looking for other resources or books on the issues.
------------------
You should also be looking for a book that explains it in terms of web architecture. The implementation of a MVC pattern between web and software development is very different. So different that I don't really even consider them to one of the same. People just like to term it MVC, but really its not a true MVC. So reading software app books in terms of MVC will probably make you even more confused. The web app implementation of the controller acting as the bridge between the view and model isn't a true application of MVC in terma of software architecture. However, it seems to be the common implementation when it comes to the web realm. So look for something that explains it in terms of the web.

There was only one book which explained the concept of application layers to me in a way I finally understood.
Patterns of Enterprise Application Architecture (POEAA) by Martin Fowler.
Hard back, expensive but well worth it. Half of the book is meant to be read word for word like a novel. In this he explains the different application layers. This certainly explained the necessity for MVC but also sent me away the mental building blocks (descriptions and handles) to appreciate when not to use MVC.
The other half of the book contains a lookup of design patterns each with a narrative explaining how one pattern is similar to others, and yet how they differ. There are numerous cross links between patterns and it is very easy to browse your way through the pattern library in a way which reminded me a lot of hypertext.
Most of the code examples can easily be followed because they are in Java and are not too dissimilar to PHP5 now.
About half of these patterns deal quite thoroughly with the model layer.
This was the only book I ever came across that fully explained MVC to me, in a way where I went *ding* I get it.
But we are all learn differently.
Last edited by Cups; Apr 11, 2009 at 03:35. Reason: tried to make hypertext ref more logical
Is anyone building their own? And if so.. what might be good practices?

Common practices are documented in the PHP Application Design forum, discussions go back for years ... search there - there is plenty of argument. What is best practice for one coder is not best practice for another.
Bookmarks