LS> The ReadOnly interface messes up the contracts for absolutely no 
LS> benefit.
Agreed. Just my lack of experience! :-)

LS> Regarding the WriteProtectable interface:

LS> Making something read-only is almost always done as a part of the 
LS> creation process: You create an object, then you initaialize it
LS> somehow, then you make it read only and finally you pass it to
LS> clients.

Still not completely convinced.
Please refer to the examples in the letter to
Niclas, don't they protect the opposite opinion?

LS> The thing is that if you are the one creating an object, you already
LS> know everything about it, and you should call the object's own
LS> makeReadOnly() method.

This may be part of object's contract: it still allowes modification
of its contents after creation and then "sealing" it. Why can not
such contract exist?

LS> If you don't know everything about the object you are initializing,
LS> for example, if you use an abstract factory to create the instance,
LS> how can you be sure that you are allowed to make it read-only?

For instance because the type of the objects returned from the
factory includes the WriteProtectable interface explicitly.

- Anton


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to