-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jonathan,
Jonathan Mast wrote:
> class BeanBag {
> private static AppleBean appleBean = null;
> private static BananaBean bananaBean = null;
>
> public static AppleBean getAppleBean() {
Might I recommend that you use a "regular" class instead of one
> From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
> Subject: Re: replacement for useBean directive
>
> do I really need synchronization at all?
Short answer: yes.
> Is synchronization really called for here, either
> around the getITEM() methods inside the beans or
&g
Thanks Chuck, just one more question: do I really need synchronization at
all?
These Beans basically work like this:
getApple(int appleID) {
purgeIfTimeout(); //calls appleMap.clear() if we've timed out
if (appleMap.containsKey(String.valueOf(appleID)) {
return (Apple)appleMap.get
> From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
> Subject: replacement for useBean directive
> wouldn't making the methods in BeanBag synchronized be
> a better approach?
Definitely. Centralize the required synchronization rather than burdening each
caller with it.
- Chuck
THIS CO