Swing with beans

Can Swing be used with JavaBeans, or must one use AWT?This:http://java.sun.com/developer/onlineTraining/Beans/JBeansAPI/shortcourse.htmldoens't mentioned swing too much.
[198 byte] By [allelopatha] at [2007-11-27 3:05:16]
# 1
JavaBeans provide a model for your data, which really has nothing to do with GUI's.You can write any java application using JavaBeans.
maple_shafta at 2007-7-12 3:50:38 > top of Java-index,Java Essentials,Java Programming...
# 2

Hmmm. I thought the beans were used primarly to produce gui components via a visual editor. The link says that "There is nothing about the JavaBeans framework that implies that Beans should be graphical objects" but still graphical objects seems to be its primary use. Maybe I am incorrect, though.

allelopatha at 2007-7-12 3:50:38 > top of Java-index,Java Essentials,Java Programming...
# 3

> Hmmm. I thought the beans were used primarly to

> produce gui components via a visual editor. The link

> says that "There is nothing about the JavaBeans

> framework that implies that Beans should be graphical

> objects" but still graphical objects seems to be its

> primary use. Maybe I am incorrect, though.

That's because at the time, the main use of beans the designers foresaw was creating reusable widgets and the like to be plugged into the pallettes of IDEs. Things didn't quite work out that way though, much like the complete failure of applets to set the web on fire

georgemca at 2007-7-12 3:50:38 > top of Java-index,Java Essentials,Java Programming...
# 4
> the complete failure of applets to set the web on fireToo much of a reliance on applets has caused me to set a Java book or two on fire.
DrLaszloJamfa at 2007-7-12 3:50:38 > top of Java-index,Java Essentials,Java Programming...
# 5

That link also says:

The JavaBeans API includes several interfaces and classes in the java.beans package. In addition, it employs interfaces and classes from other Java technology API areas including:

* The Java event model: java.util.EventObject, java.awt.event

* Object serialization: java.io.Serializable, java.io.Object*

* Reflection: java.lang.reflect

I use events and serialization often. Does this means I have java beans experience?

allelopatha at 2007-7-12 3:50:38 > top of Java-index,Java Essentials,Java Programming...
# 6
Sorry, we were looking for someone with cutting edge experience in POJO technology.
DrLaszloJamfa at 2007-7-12 3:50:38 > top of Java-index,Java Essentials,Java Programming...
# 7

> That link also says:

> The JavaBeans API includes several interfaces and

> classes in the java.beans package. In addition, it

> employs interfaces and classes from other Java

> technology API areas including:

>

> * The Java event model: java.util.EventObject,

> java.awt.event

> * Object serialization: java.io.Serializable,

> java.io.Object*

>* Reflection: java.lang.reflect

> use events and serialization often. Does this means

> I have java beans experience?

No. In fact, it makes no mention of your competencies whatsoever

georgemca at 2007-7-12 3:50:38 > top of Java-index,Java Essentials,Java Programming...
# 8

According to wikipedia (not the ultimate source i realize) A JavaBean is a POJO that is serializable, has a no-argument constructor, and allows access to properties using getter and setter methods. By that definition, i do have java beans experience.

You've addressed (and somewhat answered) the question in the back of my mind: What's the big deal with "beans"?

allelopatha at 2007-7-12 3:50:38 > top of Java-index,Java Essentials,Java Programming...
# 9
> You've addressed (and somewhat answered) the question> in the back of my mind: What's the big deal with> "beans"?JavaBeans are a key component of the expression language in JSTL, which is the modern way to write JSPs. (Just Say No To Scriptlets.)
DrClapa at 2007-7-12 3:50:38 > top of Java-index,Java Essentials,Java Programming...
# 10

The JavaBeans framework provides a "standard" api for bean components. That's the big deal. It doesn't sound like much until you grasp the idea that by implementing the standard certain things can be assumed true and that opens up possibilities for things like builders, and portability and such.

It's not a silver bullet it's a way of approaching things. I've found it interesting over the years that at different times the development community has maintained that accessors and mutators are bad and should never be used, or this or that other thing or some other fancy that comes down the pike and is the "Next big thing".

Just my 2 krupplenicks on the subject, your milage may of course vary.

PS.

puckstopper31a at 2007-7-12 3:50:38 > top of Java-index,Java Essentials,Java Programming...
# 11
Frameworks that depend on reflection, like Hibernate, also work best if you define POJOs.
DrLaszloJamfa at 2007-7-12 3:50:38 > top of Java-index,Java Essentials,Java Programming...