I tend to type a lot so I'll start with the question itself:
Why is Contao using the keywords private and protected? and how do I benefit from the fact Contao does it?
I've been bugged a bit by the visibility of certain properties and functions within Contao. I had an issue viewtopic.php?f=9&t=2673 which was solved by extending a Contao class. But extending Frontend means more processing needs to be done, without the processing the result would have been the same. In short; I do not understand why I need to extend a class to be able to change a property value.
Why is Contao using the php5 visibility keywords private and protected. I can see why a programmer would decide to use the keywords, but I cannot see what the actual advantage is. Some of my problems would be easier solved if all where public. And the protected keyword I just do not get because as soon as I extend a class that includes the property or anancestor class I can access it anyway at the cost of more processing power and memory being spent.
I found at least one person who seems to agree: http://aperiplus.sourceforge.net/visibility.php
It seems it isn't even implemented entirely logically (though I must admit I do not agree to what the author states, but that might just be me...): http://justinsomnia.org/2008/05/surpris ... 51-and-52/
In any case; why is Contao using the keywords private and protected? and how do I benefit from the fact Contao does it?
Bookmarks