Yii Framework Forum: I'm Wondering What Design Pattern The Yii Component Object's Behavior Implements. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

I'm Wondering What Design Pattern The Yii Component Object's Behavior Implements. Rate Topic: -----

#1 User is offline   kernel 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 91
  • Joined: 22-November 10

Posted 16 May 2013 - 03:02 AM

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.
0

#2 User is offline   Ben 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 266
  • Joined: 15-March 09

Posted 16 May 2013 - 06:10 AM

See THE DEFINITIVE GUIDE TO YII: Fundamentals/Component - 3. Component Behavior.
Don't like ads in my sig...
0

#3 User is offline   le_top 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 303
  • Joined: 08-June 10
  • Location:France

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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users