#81 Data should be held and returned as Nullable

open
None
5
2012-09-14
2008-07-29
Alex Fabijanic
No

While reviewing and doing modifications for bug report 2025916 ( http://sourceforge.net/tracker/index.php?func=detail&aid=2025916&group_id=132964&atid=725709 ), I also took some time to review recently contributed Nullable ( http://poco.svn.sourceforge.net/viewvc/poco/poco/trunk/Data/include/Poco/Data/Nullable.h?view=markup ).

It appears that, for framework consistency sake, it would make sense to modify Data:Column to hold (and RecordSet::value to return) Nullable rather than naked values. This is a consistent behavior with the RecordSet::value() overload that returns DynamicAny. DynamicAny has capability to be empty (see SF 2000408 - http://sourceforge.net/tracker/index.php?func=detail&aid=2000408&group_id=132964&atid=725712 ) and when retrieved value is null the resulting returned DynamicAny is empty. Same should be the case for statically typed returned values.

These recent (DynamicAny) and upcoming (Data) trunk changes regarding empty (a.k.a. null) values may break some client code semantics (I do not plan to back port them to 1.3), so please be aware of it and stay alert.

Anyone with an opinion or suggestion on this issue is welcome to reply.

I'll let the idea brew for a while and, if nobody objects with a good counter argument and within a reasonable amount of time, change it.

Alex

P.S. Additionally, as it currently stands, the issue with Nullable is that, IMO, the comparison logic is not sound (any comparison between two empty data containers should always yield false). This is a much broader topic and I'll elaborate in more detail later, via mailing list. Please do not respond about it in this thread.

Discussion