Is there a design pattern or strategy to deal with the following scenario:
3 different strategies for transforming strings through various different methods: decoding, decrypting, removing sections of the string at specific places, converting to array and so on.
Each strategy use different combinations of the possible transformation to achieve its end result on the string.
I have a class responsible for each transformation for example: Decoder, Decrypter, Splicer and so on. And I have 3 concrete classes that have the transformers it requires injected into its constructor.
Is there an accepted design pattern for this problem. I feel that there is a more elegant way to achieve this but cannot see it
Aucun commentaire:
Enregistrer un commentaire