I dont think we have to completely disallow Date's. That would probably require 
usage of som Qi4jDate instead - and creating a great Date API is beyond scope 
of Qi4J i think.

What about this:

On vb.prototype().att1().set(new Date()) we either store and immutable copy of 
the date (or just the millisecond value).  value.att1().get() return an 
immutable date

?

And then we simply allow a value to contain types, that are known to be 
immutable, or known types which we can handle more or less this way.


/Kent

Den 25/06/2012 kl. 10.29 skrev Niclas Hedhman:

> On Mon, Jun 25, 2012 at 3:50 PM, Kent Sølvsten <[email protected]> wrote:
>> So you are basically saying that
>> 
>> 1) The prototype for a value is mutable.
>> 2) You can assign 'primitive' values or ValueComposite's to its attributes
>> 3) A prototype cannot be assigned to an attribute of another prototype
> 
> Correct
> 
>  4) Special handling for List, Map and possibly other Collections.
>  5) Special handling for Date and Calendar (they are mutable, and
> should probably be disallowed completely!!!)
> 
>> Not sure if it worth the effort to ensure mutability inside all types of 
>> weird values in general.
> 
> Good point. It is somewhere between hard to impossible to figure out...
> 
> Cheers
> -- 
> Niclas Hedhman, Software Developer
> http://www.qi4j.org - New Energy for Java
> 
> I live here; http://tinyurl.com/3xugrbk
> I work here; http://tinyurl.com/6a2pl4j
> I relax here; http://tinyurl.com/2cgsug
> 
> _______________________________________________
> qi4j-dev mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
> 


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to