Defining a Locking Strategy

A good strategy for controlling locking is to use encapsulation to control access to properties so that an object has control of its own destiny (and that of its related subobjects).

In general, make attributes readOnly in persistent classes, references protected, and try to avoid set methods on references, as this will reduce the amount of control you have in enforcing a locking strategy.

For more details about designing and building an effective locking strategy, read "Locking" in Part 4, "Design Considerations", in the Erewhon Demonstration System Reference.