The missing method is delegated though __call to behavioral object registered to the components.
Is it a delegation pattern or something? I'd like to learn about the more formal pattern name.
Page 1 of 1
I'm Wondering What Design Pattern The Yii Component Object's Behavior Implements.
#3
Posted 17 May 2013 - 05:21 PM
Personnally I would not qualify behaviors as mixins, but rather as visitors (http://sourcemaking....atterns/visitor ) as the behavior is handed a reference to the visited class. A mixin would have at least have acces to protected members of the class it refers to.
PHP traits are closer to mixins than Yii's behaviors.
It is however - IMHO - not really either.
Also, behaviors attache themselves to events which is again IMHO neither in a visitor nor a mixin.
PHP traits are closer to mixins than Yii's behaviors.
It is however - IMHO - not really either.
Also, behaviors attache themselves to events which is again IMHO neither in a visitor nor a mixin.
Share this topic:
Page 1 of 1

Help











