You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jarmo Doc <ja...@hotmail.com> on 2005/09/21 21:46:43 UTC

boolean or java.lang.Boolean?

My WS clents can request an employee record, update it, and then return it 
to me.  Because each record contains dozens of fields and I prefer to limit 
the number of service operations, I've specified one operation 
updateEmployee(employeeRecord) rather than dozens of individual operations 
such as setName(name), setDOB(date), setSalary(salary) and so on.

One problem with this approach is that the client sends me the whole record 
which I then have to diff to find out what changed.  In an attempt to 
transmit just the changes, the client can create a new employeeRecord 
object, set just those fields that have changed (and the employee ID) and 
send that back to me.  With an Axis client, this results in an 
employeeRecord object wtih some fields set but most fields nil.  All unset 
boolean fields, however, are false rather than nil.  Now I can get around 
this by using java.lang.Boolean rather than the intrinsic boolean but I 
don't know how this would impact non-Axis, non-Java clients.  Would they 
fold java.lang.Boolean back to some intrinsic boolean and hence always send 
me false rather than nil?  If so then I'm dead, of course, because I would 
then be updating based on that false value when the client hadn't even 
specified a change to that field.

Or, from a higher perspective, should my interface be completely different?

Thanks very much.

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963