lundi 3 août 2020

Set up nice design pattern php

I am learning about design patterns. Currently I am working on a web service and I have time to structure the code, where I want to implement some design patterns.I already do watch to have each class doing one related thing, and write small functions with one or two parameters, but when it comes to design patterns, I am stuck.

My application is getting the data from external api, users, organizations and jobs. I have created these three classes, and currently they are all containing almost same curl call, same curl options and headers. And each of this class have one function, for organizations - getOrganizations, for users - getUsers ... Which all have same body, just a different curl call.

So I need just a reference, to a design patterns that can help me structure maintainable code.

Aucun commentaire:

Enregistrer un commentaire