[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [ajug-members]: Sharing data among Swing windows



Burr Sutter said:
> You described singleton fairly well.
> Here is a link to an article on that one.
> http://www.javaworld.com/javaworld/jw-04-2003/jw-0425-designpatterns.html
> It is very useful for keeping up with "global" data.  I believe it's scope
> is limited to the classloader and you normally use the default one making
> it
> JVM global.  I've not tested it with multiple classloaders.
>
> For constants use static final variables.
>
> For "properties" that can change dynamically at runtime and have an impact
> on other running programs I've used the "observer" pattern.
> Article on that topic:
> http://www.javaworld.com/columns/jw-java-design-patterns-index.shtml
>
> You can combine the singleton and the "subject" (aka event source, message
> generator) of the observer to make changes to global data broadcast to all
> active windows.
>
> I've had user requirements to allow windows to be dynamically linked.
> Something like a customer inquiry screen allows the user to find a
> specific
> customer record.  Selecting a customer dynamically syncs up with the order
> history and accounts receivable screens running in the background.
>
> Burr

Great resources, thanks.

I appreciate the help from all who responded.  You've put me on the right
path...for that I'm very grateful!

John