我需要一些更有经验的程序员的帮助。我想提高我的 MVC 技能。但我在 Google 上找不到 MVC 的好教程。谷歌总是给“初学者的MVC”。
我了解 MVC 是什么并且我可以做到,但是我没有足够的经验来做一些实际的 OOP。
如果有人知道 MVC 的面向对象的优秀教程,请指导我到正确的地方 — 我正在寻找好的链接、书籍等。
最佳答案
Links, that contain PHP-only materials, are marked with php for easier identification.
在全面了解 OOP 之前,您甚至无法开始深入研究 MVC。这包括 OOP 实践 ( dependency injection , unit testing , refactoring ) 原则 ( SOLID , SoC , CQS , LoD ) 和常见模式(不,单例不是面向对象的模式)。
MVC 是一种高级架构设计模式,需要扎实的理解。它不适合初学者或小型“hello world”应用程序。当简单地遵循 OOP 实践变得过于松散而无法控制代码库时,可以使用 MVC 向代码库添加额外的约束。
我能给你的最好建议是从扩展你对面向对象代码的知识开始:
上面的两个讲座应该涵盖基础知识。然后继续:
- Inheritance, Polymorphism, & Testing
- Unit Testing
- Global State and Singletons
- Don't Look For Things!
当您了解本系列中的所有内容后,您可以扩展:
- Don't be STUPID, Grasp SOLID! php
- The Principles of Agile Design
- Advanced OO Patterns ( slides ) php
- Beyond Frameworks ( slides ) php
- Agility and Quality php
- Beyond Design Patterns php
另外,我强烈建议您阅读(按此顺序):
- Design Patterns Explained
- GUI Architectures
- Inversion of Control Containers and the Dependency Injection pattern
- Patterns of Enterprise Application Architecture
- Domain-Driven Design: Tackling Complexity in the Heart of Software
P.S.: you might also take a look at this book (cautiously, because it has issues): Guide to PHP Design Patterns php
关于php - 适用于高级 PHP 开发人员的 MVC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16356420/