I have an application object which takes data from the front end. It validates most fields. This is all fine. Now say that this object uses another utility object to, say, write a datastream to a socket. The utility class takes in certain data from the front end which has been validated initially by the app object.
My question: Should the utility object validate everything it needs before using it, or should it presume that the programmer gives it correct objects i.e. machineName string not empty, valid port number, valid data to write etc?
Its basically, should all object validate EVERYTHING they need to use b4 using or is it the application programmers problem to make sure the objects are correct?
Cal Cal
My question: Should the utility object validate everything it needs before using it, or should it presume that the programmer gives it correct objects i.e. machineName string not empty, valid port number, valid data to write etc?
Its basically, should all object validate EVERYTHING they need to use b4 using or is it the application programmers problem to make sure the objects are correct?
Cal Cal