[eluser]Neophyte[/eluser]
Im looking to make KhEvent a bit more dynamic in the way it loads its observers the 2 approaches ive been considering are as follows.
Groups:
When you trigger an event you can optionally specify a group eg. $this->event->trigger('onLogin', array('username', 'password'), 'auth'); this would result in all files within the auth subfolder being loaded if they were not already loaded.
Mapping:
A map of all the events which have listeners is created so when an event is triggered any observers which arent currently loaded but which have methods correlating to said event will be automatically loaded before the dispatching of the event. (obviously the map would be cached)
Im just looking to see if anyone has any opinions/preferences on the above approaches or any alternative approaches worth considering.