I have a MVC application which uses events(hooks) and I have a question about when to trigger an event.
There are three options:
- trigger in models(this approach will mess-up the code, but gain a little more flexibility)
- trigger in controllers(after or before calling some models)
- creating a new layer of abstraction between controllers and models that extends my models and trigger the event(decorator pattern)
Thank you