Hey Mariano,

On 11 Jan 2012, at 12:41, Mariano Martinez Peck wrote:

> Hi guys. I have a simple question. When we are serializing DateAndTime with 
> fuel, we serialize its 4 instance variables: 'seconds offset jdn nanos'. And 
> then, during materialization, we recreate them. I know that all instances of 
> DateAndTime have their instVar 'offset' pointing to the local timezone 
> offset, that is, DateAndTime localTimeZone offset.  In fuel, during 
> materialization, we recreate those offsets. So all materialized instances of 
> DateAndTime will have their own (different) instance of Duration in the slot 
> 'offset'.  On the one hand, I think this is necessary becase you can 
> materialize in a different image with different time zone, so having the 
> timezone is mandatory. What I don't know, and this is the question, is if the 
> timezone is the same between serialization and materialization image, MUST 
> all materializated DateAndTime point to the same offset?   or it is just an 
> optimization that they all point to the same?
> 
> Thanks in advance,
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com

To answer the question first: I think its only an optimization, not a 
requirement. (But the system should share them ;-)

But I don't understand: if you serialize all 4 inst vars, and if the offsets 
would be shared before, then they would be shared after materialization as 
well, no ?

Also note that it is certainly not an invariant that all offsets of all 
instances of DateAndTime are equal to the local offset, most of the time we are 
using offset 0 (UTC), for example.

Serialization of a DateAndTime from an image with local TZ 1 and 
dematerializaing in another image with local TZ 2 will still work in the sense 
that the time is correct, the instances in the new image will just have a 
non-local TZ. They could be converted to the local TZ, but I don't think this 
should happen by default.

Sven

Reply via email to