jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tako Schotanus" <quinte...@gmail.com>
Subject Re: 3.1.3.1 Removing Items
Date Fri, 20 Jul 2007 08:49:42 GMT
On 7/20/07, Alexandru Popescu ☀ <the.mindstorm.mailinglist@gmail.com> wrote:
>
>
> On the other side, I still think that there are cases where NULL and
> non-existant may mean different things.
>
> Confusing isn't it? :-)


To me there is no confusion, null in either a programming language or a DBMS
means the absence of value.

That YOU add a specific meaning to the absence of that value is okay, but it
is generally considered bad practice because it is not obvious just by
looking at the data what your intentions are. In those cases it is suggested
that you explicitly model the different states that you want to recognize.

So instead of doing the following for example:

<!-- requested and got the information -->
<data>
   <someInformation>The contents...</someInformation>
   .
   .
</data>

<!-- requested and received empty information -->
<data>
   <someInformation />
   .
   .
</data>

<!-- requested but didn't get the information -->
<data>
   <someInformation isNull="true" />
   .
   .
</data>

<!-- haven't requested the information yet -->
<data>
   .
   .
</data>


It's much better to explicitly state your intentions:


<!-- requested and got the information -->
<data>
   <someInformation requested="true" received="true">The
contents...</someInformation>
   .
   .
</data>

<!-- requested and received empty information -->
<data>
   <someInformation requested="true" received="true" />
   .
   .
</data>

<!-- requested but didn't get the information -->
<data>
   <someInformation requested="true" received="false" />
   .
   .
</data>

<!-- haven't requested the information yet -->
<data>
   <someInformation requested="false" received="false" />
   .
   .
</data>


(although I can understand that in the last case you'd rather just leave out
the element)

Cheers,
 -Tako
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message