-
Notifications
You must be signed in to change notification settings - Fork 3
Event naming convention
Currently event name in framework does not include context(reference entity) so decision need to take whether it should be added in the name or leave this on component to handle this at their own level.
With option 1,
-
We can have entity specific events so no extra context checking is required for further execution.
-
Above point will ultimately prevent impact on performance
With option 2,
- Yes, we can offer common events which can be utilized in multiple components but at the cost of performance and even entity specific events can be utilized for the same without any issue.
Decision :
We have decided to go with the option 1 which includes
-
Go with less features
-
Context(entity name) should be added in the entity specific events For ex. events which are related to lib objects like object-save, object delete etc.
-
Framework related events must be independent of context.
Decision on June 4th, 2013 :
-
Currently RB Framework triggers event like onRBViewAfterRender. If we have multiple extension working on RB Framework, possibility of number of trigger will be much more, because each extension will get this trigger and will check whether it should work on this event. So we have dropped this idea.
-
If We use ClassName in event name, than it will be extension specific as well as entity specific. In this case number of trigger will be minimal, but number or event name will be maximum. So it will require extra efforts for managing documents. So we have dropped this idea also.
-
So we have adopted intermediate solution. We will use Component->PrefixClass in event nameand send Entity Name as argument, so that entity name can be checked by the function itself. In this case number of events and number of trigger, will be at intermediate level.