| |
| | Use Callbacks to Isolate Concurrency Bugs |
 | | When the callback object is done using the data, the gatekeeper passes the data to the next callback object. |
 | | A callback, on the other hand, cannot access the data until that data is passed to the method, and it cannot access the data after the method is finished. |
 | | Of course, you easily could protect c by hiding it behind a synchronized access method, but as mentioned previously, this article's purpose is to explore an alternative method of data protection, one you would use when regular synchronization is either difficult or undesirable. |
| www.devx.com /Java/Article/28156/1954?pf=true (1816 words) |
|