lundi 2 août 2021

suitable design pattern for constructer with different parameters

i want to make a website using a design pattern, it's a carpooling system, i have different options, like a ride with a destination, a ride with no destination, a connected ride with two destinations, each option has it's own form, i want to have a class that takes info from the forms and use a functions to do something based on what was passed, is there any design pattern i can use so i can call the same class constructer but with different parameters so i don't have to make a class for each option? or is there any other good approach to this using design patterns? i'm kinda new to OOP so i need some ideas and advices please, i don't have any code to show you, so please don't vote this question down.

Aucun commentaire:

Enregistrer un commentaire