In 1.x, several classes have a method named init() which is called after constructor and property initialization.
In 2.0, I am thinking to put this into the base Component class and by default init() will call behaviors() to register declared behaviors.
Accordingly, Yii::createComponent() will be modified to call init() after creating a new component.
What do you feel about this change?
more unified than 1.x: every component will have init(), not just app components, models.
behavior registration is more standardized. In 1.x, some components may not attach behaviors unless you explicitly attach them.
performance degradation: now every component instantiation will have an additional call to init(). This may not be a big issue, however.
every component will have a method named ‘init()’, which is probably too common and may conflict with the similar needs in child classes. Perhaps this is not a real issue either, though.