Niclas Hedhman wrote:
I liked this article; http://www.artima.com/articles/hickey_on_time.html

And especially when thinking extra hard over mutability of objects and
what we can/should do about it.

Since we in Qi4j has very exact control over what each class is doing,
we could actually force some good practices into place if we think
that is a good idea.

For instance;
 * ValueComposite implementations must have final members, and we
auto-wrap known mutable types (collections, for instance) with
immutable decorators.


Discussion on this topic is encouraged.

Yeah, one of the core conclusions from the CQS discussions is the mutability of state is something that needs to be considered a lot, and when you get events into the fray the issue of "time" also becomes important.

One problem with ValueComposites and the changes you propose is that values *are* mutable during the builder-phase, but if you add "final" then that cannot be properly captured. The wrapping should be ok though, as you can add/remove it for the instance/builder.

/Rickard

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

Reply via email to