On Wed, Mar 9, 2011 at 2:29 AM, Martin Hasoň <[email protected]> wrote:

> Hi,
> In recent commits has been moved most protected methods and properties to
> private. I think it's completely unnecessary step. In PHP I dislike the
> keywords private and final (I hate their implementation in PHP). Why?
> Private methods prevent reuse of code and keyword final kills reuse of code.
> Real private methods do'nt exist in Python and Ruby (it is possible to
> call private methods or overload them). In my opinion, framework should
> have almost no private methods. I don't want to use the class composition
> for every little thing.
>
> My tip: how to change value of private property in PHP 5.3 > ?
>
> class A {
>     private $a;
>
>     public function __construct() {
>         $this->a = new Foo(); //only one poorly designed place in class
>     }
> }
>
> class B extends A {
>     public function __construct() {
>         $reflection = new ReflectionProperty('A', 'a');
>         $reflection->setAccessible(true);
>         $reflection->setValue($this, new FooBar())
>     }
> }
>

Your message proves the exact opposite of your point. Your griefs come from
either willful laziness or pure and simple ignorance of basic OOP
principles. This problem has already been solved many, many years ago and
out of the solution came such things as SOLID principles. While they don't
guarantee cleanness, they probably are a good way to start and it is
certainly not a matter of providing flexibility to the framework's user but
rather to provide a product which guides them toward long-term value, i.e.
maintainability.


>  --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/symfony-devs?hl=en
>



-- 
Nicolas A. Bérard-Nault ([email protected])

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to