On Feb 22, 2012, at 10:45 AM, Left Right wrote:

> I honestly believe that a concept of 3 different nulls (null, undefined and
> false) in ECMAScript is... well, just yet another thing ECMAScript did
> wrong. By reducing it to 2 nulls HaXe did it some justice, but I'd still be
> happier with only one :P

I understand the point but I do have to admit that I like having the different 
possible values.  The context of null or undefined to keep track of VO 
properties has been really helpful in ORM's when you have DB's like MySQL that 
accept null values.  

Shortened example:

public class UserVO extends AbstractVO
{
        private var _age:*;

        public function get age():Number
        {
                return _age;
        }
                
        public function set age(value:Number):void
        {
                _age = value;
        }
}

The AbstractVO Class has some helper functions and a writeExternal() hook that 
allows us recreate a basic VO and determine which private properties to ignore 
(undefined), set as null in the DB or set a legitimate value to (which could be 
'false') for CRUD operations.

-Rob

By the way I've enjoyed reading your feedback.  Great insight.

Reply via email to