Skip navigation.
 
mlRe: Re: Accessor method styles
FROM : Shawn Erickson
DATE : Tue Aug 29 18:08:21 2006

On 8/29/06, Andrew Merenbach <andrew.<email_removed>> wrote:
> Thanks to all who clarified for me.  I now have a great deal more
> insight into the standard accessor idioms.


I should point out that none of the variants you listed are thread
safe (not that you implied they are).

To gain thread safety use of locks or coherency domains/contracts
would need to be used... note placing locking inside of the setter is
often too granular to be useful, it really only helps to ensure the
object itself is internally consistent but code outside of that object
often needs locking to keep itself consistent as it manipulates your
object. In other words placing locking inside of a setter can easily
result in duplication of effort (overhead) without solving the larger
coherency needs of the application.

-Shawn

Related mailsAuthorDate
mlAccessor method styles Andrew Merenbach Aug 29, 16:53
mlRe: Accessor method styles Shawn Erickson Aug 29, 17:15
mlRe: Accessor method styles Ricky Sharp Aug 29, 17:18
mlRe: Accessor method styles Alberto Ricart Aug 29, 17:51
mlRe: Accessor method styles Andrew Merenbach Aug 29, 17:57
mlRe: Re: Accessor method styles Shawn Erickson Aug 29, 18:08
mlRe: Accessor method styles Sean Murphy Aug 29, 18:10