jeudi 9 juillet 2020

Can two strategies in a strategy pattern use the same code? Does this make it a template pattern?

I have a program to transfer files from one computer to another which uses 4 different classes A, B, C and D. My program creates an object and uses A and B to check and validate the files to be sent. Now I have to add an additional transfer technique. I guess using strategy pattern would be the best case scenario since we can choose either of the transfer techniques. But I wanted to ask whether or not can we use classes A and B to validate the transfer of files in my strategy also? Does this make it a template design pattern rather than a strategy design pattern?

Aucun commentaire:

Enregistrer un commentaire