I've asked this several developers, and gotten different answers every time.
Let's say I'm working in an MVC framework and I have a class called validator
. Say this object has a bunch of methods which can be used to tell you if an email or phone number is valid, or if a given value actually has content in it.
Say I want to make this service a property of a model that I'm creating. I can simply inject it into the construction method of my model class. However, where does this service fit in in MVC? Is it a model?
Where should the file be stored? With the models? In it's own directory, perhaps called services
?