lundi 15 février 2016

Laravel 5 Event - Is this a mediator or observer?

I was discussing Laravel's event system with another developer today. He mentioned that Laravel's event dispatcher uses an observer pattern.

I always thought it implemented a mediator pattern as your objects always listen/fire events through an event dispatcher object, but the doc says it is an observer.

Event::listen('event.name', function ($foo, $bar) {
    //
});

Event::fire("event.name", []);

Isn't this a mediator pattern?

Aucun commentaire:

Enregistrer un commentaire