Proposal: nullable wrapper class for primitive data types (int, Number, Boolean)

Anderson, Todd todd at
Fri Sep 21 06:54:33 PDT 2007



Background ES4 WIKI:

Background Flexcoders Discussion:


Issue: When working with sql database record sets, often the recordset
will return a null value for an int or boolean typed column.  This means
the column is in a state of "value undetermined" or "not yet set".  When
a recordset is returned into a Adobe Flex 2 VO containing, for instance,
an int, the value is reduced to the default value of 0.  Since "not yet
determined" and 0 are not equivalent, then this becomes an erroneous
conversion and will corrupt any update calls back to the database.
Since the primitive types are not extensible, then there is no current
workaround for this issue.


Proposal: To allow for a wrapper classes that will enable nullable
primitive data types.  Therefore, the type of int, Boolean, Number, etc
will still remain the same (not nullable), however a proposed type of
NullInt, NullBoolean and NullNumber would behave the same as the
primitive types, except allowing them to be set to null.


Rationale: Allowing a change such as this allows developers who work
with database recordsets (the vast majority) to accurately reflect the
data that is in the database.  If the data in the database is
automatically converted to a default value in a "hidden" way, then many
developers will have an error situation on their hands and may not know


Thank You.


-Todd Anderson

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Es4-discuss mailing list