Modeling Services > Entry and Derived Data Members > Derived Data Members > Eager Versus Lazy Derived Data Members
 
Eager Versus Lazy Derived Data Members
A derived data member can be assigned two different states: it can be eager or lazy.
By default, a derived data member is lazy. A derived data member marked as eager is recomputed at each explicit call to the function IlsReevaluate or during each re-evaluation phase of the interaction cycle. A lazy derived member is evaluated only on demand.
However, a lazy derived member that is transitively eager will also be recomputed during a re-evaluation. A derived member is transitively eager if an eager derived member depends on it. In the evaluation algorithm, transitively eager derived members are handled as eager derived members, so that eager values depending on them are systematically maintained up-to-date.
A derived data member is made eager by a call to the function IlsDerived::incrEagerness:
passengers.incrEagerness();
To reset a derived data member marked as eager to its default state, you can invoke the function IlsDerived::decrEagerness:
passengers.decrEagerness();
Eagerness is managed by a counter rather than a simple Boolean value. It is only when an equal number of calls to incrEagerness and decrEagerness have been performed that a derived data member is not eager anymore.

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.