Nulls and business objects.
For the longest time I have struggled to come up with a clean way to deal
with Null values when creating business objects that read data from a
database. In my particular case, I program in VB, VB 6 to be more specific.
And if there is one thing that I wish, is that VB had variables such as
Integers with the capability to not only receive numerical integer values
but also Null values. We would finally have a nice clean one to one
representation of the data from the database and the object model.
I currently use tricks such as Variants, assign default values such as a
person's age being -1, etc. Needless to say this is annoying and just one
more way to introduce bugs etc. Why can't there be a variable that does
this. Somebody suggested one being out there but I have not been able to
How do you guys deal with this issue? Does languages like Delphi allow you
to do this?
PS: There are some cases where I believe that using Null values is a great
idea, I don't want to get into a philosophical debate here, so not allowing
Nulls is not the right solution for me.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center