Say I have a SSN field in a form. I want SSN to be in format of
I may just have a SSN formatter checking whether the input are all digits and adding dashes when necessary.
Another option is to have both SSN formatter and validator. SSN formatter doesn't check type or range, so it accepts
asdfghjkl and formats to
asd-fg-hjkl. Then regular expression validator kicks in, telling me the input doesn't matach pattern
If formatter does both formatting and validating, is it single responsibility?