For a gaming project I have to write PHP scripts that handle notifications from a third party service. Notifications are sent to a specific endpoint via an HTTP
request. I receive among other informations codes
(ex: 23, 12,10, - more than 20 statuses exists). Each code
should trigger very different operations (database query, HTTP request ...) in my system.
Is there a way to write a clean code that handles it respects SOLID
principles ?
Here is my reflexion now :
- A class that receive the notifications
- One class per
code
implementing a common interface
Aucun commentaire:
Enregistrer un commentaire