How to cater for missing input to a class
View Single Post
08-26-2009, 03:28 PM
Join Date: May 2009
I dont want to hard code the variable no.
I'll try and make it more simple:
I have created a class (a stand alone component of functionality). I have no control over what goes into that class all I know is i need 2 pieces of information to instantiate the object. I want to build in some kind of validation into the class this is there a way I can check for existance of the 2 variables inside the class?
I dunno i feel i am just talking round in circles. Either i validate the variables outside of the class and make sure they are in existence before i pass them in to the class or I do it inside the class. I'd rather find a way of doing it inside the class otherwise it isnt a very robust class if the whole thing falls over when it get unexpected input.
View Public Profile
Send a private message to captainmerton
Find More Posts by captainmerton