Good day.
I have put validations on the Data class that prevent users from putting invalid data in the database file.
My problem is that putting validations is not a must requirement, so I want to remove them.
Is it safe to assume that people who use the Data class will always pass valid information to the methods of the Data class?
I mean is it safe to assume that users who call read(recNo) will pass a recNo >= 0 always ?
Is it safe to assume that when users call create(String[] record) record will not be null ?
Is it safe to assume that the elements of String[] record will not be null ?
Is it afe to assume that the size of String[] record is 7 ?
If I remove the validations, then the Data class will fall over if users pass invalid data to the methods of the Data class.
They will get NullpointerExceptions and ArrayIndexOutOfBoundException.
I have put validations on the Data class that prevent users from putting invalid data in the database file.
My problem is that putting validations is not a must requirement, so I want to remove them.
Is it safe to assume that people who use the Data class will always pass valid information to the methods of the Data class?
I mean is it safe to assume that users who call read(recNo) will pass a recNo >= 0 always ?
Is it safe to assume that when users call create(String[] record) record will not be null ?
Is it safe to assume that the elements of String[] record will not be null ?
Is it afe to assume that the size of String[] record is 7 ?
If I remove the validations, then the Data class will fall over if users pass invalid data to the methods of the Data class.
They will get NullpointerExceptions and ArrayIndexOutOfBoundException.