I think this is a generic question that's faced by most XML-based data exchange 
languages (WDDX, XML-RPC, SOAP, etc) but I'm using YODEL.

The problem is that we have fields in the datasource which allow nulls in typed 
cells (most DBs do this: a column can be "number" or "Boolean" but still allow 
nulls).

How should a data exchange language deal with this?  With a typed cell but no 
value?  For example

In WDDX you might see: <number></number>

In YODEL you might see: <d type="number"></d>

In XML-RPC you might see: <value><i4></i4></value>

and so on.

I can see several potential solutions:

1) Throw an error.  You said I was going to get a number, but I don't see one.  
This is easiest, but seems likely to cause problems when some values are 
unknown (likely with some data sources).

2) Allow nulls - set anything empty like that to null (or the platform 
equivalent).  This I think would work... but would be very odd in practice - 
the consuming platform would then have to check constantly to see if a presumed 
"number" value was a number.

3) Default the value ("new number") to what the platform supports as a 
"uninitialized" value (for number, say a zero, for a date perhaps now(), for a 
boolean "false" and so forth).  This seems to make the most sense to me on some 
levels... but is also the most likely to create bad data (converting a null in 
a database boolean column to "false" changes the data - and that can't ever be 
good, can it?)

What doi you guys think?  What do other implementations do (I'm having trouble 
finding documentation on this).

Thanks,

Jim Davis

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227096
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to