It's said bad. Because it will allow the internal states to escape. But the code like this is always common in the application, especially some java beans.
Also according to the book, I find many errors in my application, and in the previous application I ever saw.
What does that mean? It means lots of applications in use have concurrency problems?
If you have two blind cooks in the kitchen. One wants to make a chocolate cake, the other wants to make tuna fish casserole. But you only have one mixing bowl.
Cake cook will break two eggs into the bowl, put a cup of sugar in, and then turn to get the flour.
In the meantime, casserole cook will open up a can of tuna, dump it in, then turn to get the mushroom soup when,
Cake Cook comes back and dumps in three cups of flour then goes to get the baking powder.
At this point Casserole Cook comes back, dumps in the mushroom soup, then goes to the pantry to get the pasta,
Now, the Cake Cook comes back dumps in the baking powder and.....
if you get the idea, what two EXCELLENT cooks have created .... was a mess. Because, access to the bowl was not "synchronized". If the bowl would have been "synchronized" Cake Cook would have gained the bowl, Casserole Cook would have had to wait.
A consumer would have no way of knowing whether the underlying application architecture made proper use of "synchronization" unless they read some reviews first.... because I'd bet if they didn't there would be some reliability problems posted.
Kind of like a "Tuna Fish/Chocolate Cake" !
------------------------
Bob
SCJP - 86% - June 11, 2009
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Also according to the book, I find many errors in my application, and in the previous application I ever saw.
What does that mean? It means lots of applications in use have concurrency problems?
I'm currently reading that book, too. It's frightful in that regard (and quite good, by the way). I've revisited a few pieces of code I've written to fix things I learned from it.
I have had moderate but real success, along with others, working such issues htere as:
How many hours do you sleep every day?
Which is your best and worst moment of your life?
Do you plan to get iPhone ?
Analog guitar distortion
best place to learn SAP ?
Paul Potts - Video
Diet Hacks David O'Meara
Robots Taking over the World! (and cleaning)
Shivaji - To be released
"Even I" vs. "I also"
Net Nanny, et al
DIY: Aphorism
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."