When I instantiate a new object, what should I do with the parameters that get passed in in terms of validation?
I'm guessing it's not safe to just assume the parameters coming in are fine, however I thought validation should be separated into another layer?
For example, if a class takes a start time and and end time the things the class should require:
start_time
andend_time
are both valid datetime objectsstart_time
should be beforeend_time
Any direction with what is okay to validate in class constructors, if anything at all as well as any general information about where validation should take place would be helpful.
It might be worth noting I'm trying to work with an MVC structure.