On Wed, May 16, 2012 at 4:11 AM, Brian ROONEY
<brian.xb.roo...@stericsson.com> wrote:
> Is there any way to I can take control of MX::TD::A such that I can decide 
> when to start the dirty tracking?  Specifically, below,  the attributes in 
> Foo::Types::Parameter are populated by reading in a file Foo::Reader->read.  
> Only after reading in, I then want to trigger the dirty tracking.
>
> Currently the dirty tracking starts after construction of 
> Foo::Types::Parameter which means Foo::Reader::File->param->comment  is 
> immediately dirty  when reading from the file. :(

A couple options come to mind.

* Create a clearer for the attribute, and call it before setting the
value.  (Calling a clearer "resets" the dirty status)

* Make your attribute lazy; this should prevent any value from being
set during construction (assuming no value has been passed to new for
it), so the attribute will not be dirty.

                                -Chris
-- 
Chris Weyl
Ex astris scientia

Reply via email to