lundi 28 juin 2021

Which design pattern I should use in this case

I have a class (let's call it BugFinderCommand) which will be responsible for finding bugs (in ex. missing schedule payment) in loan schedules.

The scenario would look like this: The cron will run BugFinderCommand and it will iterate all the schedules. If a bug is found, it would return a message, in ex. "Missing 5th schedule payment" and I would store these messages in array and then in excel file.

Currently, we know just two bugs, but we are SURE that in future we will find more of them.

I was wondering, which design pattern would fit best and it would be easy to extend with new bugs? Would be cool if each bug check logic would stay in new class.

I am using php (Symfony) if that helps.

Aucun commentaire:

Enregistrer un commentaire