I’ve been using Yii as my second framework for a couple of years and I like it. But I have annoying question: why, why you guys use private scope in framework classes instead of protected?! It’s craziness, it makes terrible extending of the base functionality, I have to copy your base classes to extend their functionality, not to simply extend them. Is there any explanation of this?
Hah, I just wanted to mention that article too. But actually in Yii classes there are no “too many” private methods, at least I didn’t face any big problems extending core classes. And I agree making everything public/protected can make more problems for developers, because there are no guarantees these methods won’t change in the future.
Directory name is hardcoded here, to use another directory name (not ‘views’) I should rewrite method in child class, but there are private properties… Yes, I can simply replace ‘view’ in result, but this is not good idea. Can you change my opinion?
Yeah, but Yii has many private properties… That’s a major issue in my practice, because for example you can’t just copy-paste method if it use private properties, or extend it… Or whatever you need…
I think just really low-level things should be encapsulated. All other should be protected. Of course some methods could be changed, but could be not. If developer call inherit protected method - he should know about the risk.