On 5/26/2010 7:01 AM, Adam Heath wrote:
Adrian Crum wrote:
Just a friendly reminder to the OFBiz developers and committers: The
screen widget model classes should not have their state altered by
renderers. That is not thread-safe and it results in undesirable behavior.

I know it's easy to forget - I just deprecated some methods that I wrote
where I made that mistake. :-)

It might help to think of the widget model classes as being immutable
(though technically they aren't). Once they are constructed and put in
the cache, they shouldn't be changed.

Then why not be explicit about it?  Make the classes final(maybe),
make their fields final(required), set all such fields only in the
constructor(required).  If construction is more dynamic/complex, use a
Builder pattern.

Because there is a difference of opinion about widget model immutability. I had suggested those changes a few years ago and there was opposition to it.

-Adrian

Reply via email to