Analysis and Design Principles in OOP. The Problem of Banning Inheritance in Single-Threaded PHP
summary
The talk examines the use of PHP’s final keyword and the common advice to declare classes and methods final everywhere. It explains the historical reasons this recommendation appeared in PHP, argues why blanket forbidding of inheritance is a mistake in typical single-threaded PHP, and outlines when marking code final helps, when it harms, and when it’s necessary.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 2:36What is OOP
- 3:59Object state and classification
- 5:03Multithreading and object state
- 6:52Immutable Object pattern
- 8:40Banning inheritance in Immutable Object
- 10:49Moving Java patterns to PHP
- 12:55Testing and final in PHP
- 15:02Violating dependency inversion
- 16:30Practical example: final errors in Symfony
- 19:03When to use final in PHP
- 21:49final in abstract classes
- 23:13Architectural styles and final
- 25:00Further reading
- 26:25Thanks and Q&A
- 26:47Discussion on final and testing
- 28:12final in libraries and constraints
- 31:00When final is truly needed
- 33:11final to limit class usage
- 34:13Testing problems with final
- 35:17final to restrict inheritance
related talks
29mSolid Code
45mBeyond design patterns and principles - writing good OO code
43mFunctional Programming in PHP
58mObjects, Testing and Responsibility
42mBeyond OOP: Developing PHP Extensions ... in PHP!
36mAn Introduction to OOP, Design Patterns, and TDD
48mThe Best of Strong Typing in PHP
01h 11mPanel Discussion: PHP - The journey so far (and what's ahead)
