but then you'd be open to the weird situation of having an object that
claims it is null but contains a value. 
If you need a null object, just create a new one and don't initialize
it.

/t 

>-----Original Message-----
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED] On Behalf Of Bill Rawlinson
>Sent: Wednesday, September 21, 2005 4:00 PM
>To: [email protected]
>Subject: Re: [CFCDev] Default for Dates in a Transfer object
>
>or, if you did want to null the object you could have a method,
>setNull() which just turns the flag back on.
>
><cfset myString = createobject("component","types.String")>
>
><cfoutput>#myString.isNull()#</cfoutput> <--- should return "true" --->
>
><cfset myString.init("Hello World")>
>
><cfoutput>#myString.isNull()#</cfoutput> <--- should return 
>"false" --->
>
>....
>
><cfset myString.setNull() />
>
><cfoutput>#myString.isNull()#</cfoutput> <!--- should return 
>"true" --->
>
>
>I don't know if this would be necessary or not but at least it would
>give you the flexibility to make sure it is null at some later point.
>
>
>On 9/21/05, RADEMAKERS Tanguy <[EMAIL PROTECTED]> wrote:
>> i'd go with "objects are null until explicitly initialized" 
>- you could
>> track it with a private attribute and then toggle that from 
>within the
>> init method. You don't ever need to "nullify" an object once 
>it has been
>> initialized...
>>
>> /t
>>
>> >-----Original Message-----
>> >From: [EMAIL PROTECTED]
>> >[mailto:[EMAIL PROTECTED] On Behalf Of Bill Rawlinson
>> >Sent: Wednesday, September 21, 2005 3:32 PM
>> >To: [email protected]
>> >Subject: Re: [CFCDev] Default for Dates in a Transfer object
>> >
>> >Kerry,
>> >You would define you're own rule for what a NULL is for that type
>> >since you're creating the component.
>> >
>> >If a zero-length string is a null to you thens ure isNull 
>would return
>> >true.  if the rule was the string had to be equal to "NULL" 
>then no, a
>> >zero length string would return false.
>> >
>> >
>> >Bill
>> >
>> >
>> >On 9/21/05, Kerry <[EMAIL PROTECTED]> wrote:
>> >> >basically an isNull() method
>> >> hmm, would that return true simply if the value had zero length?
>> >> or only if it had never been set?
>> >>
>> >>
>> >> -----Original Message-----
>> >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> >> Behalf Of RADEMAKERS Tanguy
>> >> Sent: 21 September 2005 13:11
>> >> To: [email protected]
>> >> Subject: RE: [CFCDev] Default for Dates in a Transfer object
>> >>
>> >>
>> >> >Another option is to roll your own date object and pass an
>> >instance of
>> >> >it into the function instead.
>> >>
>> >> Actually, this could be one way around the whole type 
>safety / null
>> >> problem with cf - develop a system of object types (Date.cfc,
>> >> Integer.cfc, String.cfc, etc). Then you could choose to work with
>> >> "primitives" (the regular built in cf data types) which are
>> >loosely and
>> >> dynamically typed and have no concept of null, or with 
>object types
>> >> which are statically, strongly typed and do (well... can)
>> >have a concept
>> >> of null (basically an isNull() method).
>> >>
>> >> The two biggest problems i can see with this approach is
>> >that a) object
>> >> types would be more cumbersome to work with, since you 
>would have to
>> >> call methods to do what you do with operators on primitives (ie no
>> >> MyString = "hello world" when MyString is an object type,
>> >and certainly
>> >> no MyArray[1] = "value") and b) performance - creating
>> >instances being
>> >> expensive.
>> >>
>> >> On the other hand, i'd think it would be extremely 
>unlikely that the
>> >> built-in cf data types will support the notion of null 
>values anytime
>> >> soon, since that would break a lot of existing code.
>> >>
>> >> /t
>> >>
>> >>
>> >> ----------------------------------------------------------
>> >> You are subscribed to cfcdev. To unsubscribe, send an email to
>> >> [email protected] with the words 'unsubscribe cfcdev' as
>> >the subject of the
>> >> email.
>> >>
>> >> CFCDev is run by CFCZone (www.cfczone.org) and supported by
>> >CFXHosting
>> >> (www.cfxhosting.com).
>> >>
>> >> CFCDev is supported by New Atlanta, makers of BlueDragon
>> >> http://www.newatlanta.com/products/bluedragon/index.cfm
>> >>
>> >> An archive of the CFCDev list is available at
>> >> www.mail-archive.com/[email protected]
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> ----------------------------------------------------------
>> >> You are subscribed to cfcdev. To unsubscribe, send an email
>> >to [email protected] with the words 'unsubscribe cfcdev' as
>> >the subject of the email.
>> >>
>> >> CFCDev is run by CFCZone (www.cfczone.org) and supported by
>> >CFXHosting (www.cfxhosting.com).
>> >>
>> >> CFCDev is supported by New Atlanta, makers of BlueDragon
>> >> http://www.newatlanta.com/products/bluedragon/index.cfm
>> >>
>> >> An archive of the CFCDev list is available at
>> >www.mail-archive.com/[email protected]
>> >>
>> >>
>> >>
>> >
>> >
>> >--
>> >[EMAIL PROTECTED]
>> >http://blog.rawlinson.us
>> >
>> >If you want Gmail - just ask.
>> >
>> >
>> >----------------------------------------------------------
>> >You are subscribed to cfcdev. To unsubscribe, send an email to
>> >[email protected] with the words 'unsubscribe cfcdev' as the
>> >subject of the email.
>> >
>> >CFCDev is run by CFCZone (www.cfczone.org) and supported by
>> >CFXHosting (www.cfxhosting.com).
>> >
>> >CFCDev is supported by New Atlanta, makers of BlueDragon
>> >http://www.newatlanta.com/products/bluedragon/index.cfm
>> >
>> >An archive of the CFCDev list is available at
>> >www.mail-archive.com/[email protected]
>> >
>> >
>> >
>>
>>
>> ----------------------------------------------------------
>> You are subscribed to cfcdev. To unsubscribe, send an email 
>to [email protected] with the words 'unsubscribe cfcdev' as 
>the subject of the email.
>>
>> CFCDev is run by CFCZone (www.cfczone.org) and supported by 
>CFXHosting (www.cfxhosting.com).
>>
>> CFCDev is supported by New Atlanta, makers of BlueDragon
>> http://www.newatlanta.com/products/bluedragon/index.cfm
>>
>> An archive of the CFCDev list is available at 
>www.mail-archive.com/[email protected]
>>
>>
>>
>
>
>--
>[EMAIL PROTECTED]
>http://blog.rawlinson.us
>
>If you want Gmail - just ask.
>
>
>----------------------------------------------------------
>You are subscribed to cfcdev. To unsubscribe, send an email to 
>[email protected] with the words 'unsubscribe cfcdev' as the 
>subject of the email.
>
>CFCDev is run by CFCZone (www.cfczone.org) and supported by 
>CFXHosting (www.cfxhosting.com).
>
>CFCDev is supported by New Atlanta, makers of BlueDragon
>http://www.newatlanta.com/products/bluedragon/index.cfm
>
>An archive of the CFCDev list is available at 
>www.mail-archive.com/[email protected]
>
>
>


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to