[TYPO3-dev] Hooks and protected class members

Jigal van Hemert jigal at xs4all.nl
Mon Nov 15 12:30:23 CET 2010


Hi,

On 15-11-2010 10:26, Popy wrote:
>> Seriously, do you want everybody to fiddle with your data?
> Not "everybody" : only friends :)

And even "friends" can be restricted to being able to read and not write...

> And, better than "friend classes", why not "friend instances" ? As hooks are
> based on object, it is not hard to give access for CURRENT hook instance.

In the __get and __set methods a check can be added to see if a 
registered hook subscriber is requesting data.

If this is implemented it must be documented that anything outside the 
passed parameters is subject to change without notice.
In many cases a hook provider passes a reference to itself, but this is 
only moderately useful because most data members are inaccessible.

Anyway, the consensus was that friends are not welcome to take a look 
inside. Friends may only see what is passed to them while waiting at the 
front door.

-- 
Kind regards / met vriendelijke groet,

Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh




More information about the TYPO3-dev mailing list