I've following code written in PHP with an PSR-4 autoloader. I'll write the code in pseudocode for convenience.
This is a small MVC'ish app that should parse requests.
new App();
App->Initialize();
new Dispatcher();
Dispatcher->Event( 'info', showInfoAction() );
Dispatcher->Event( 'addfriend', addFriendAction() );
Dispatcher->Event( 'unfriend', removeFriendAction() );
new WebRequest();
Dispatcher->DispatchEvent( WebRequest->GetRequestParameters() );
- Would that be some kind of event driven pattern?
- What would be the name?
- Would that make sense for http requests?
- Would you recommend any other pattern that does this?
Thank you
Aucun commentaire:
Enregistrer un commentaire