This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
Do JavaBeans *require* a 0-argument constructor?
Posted by Paul J. Lewis on September 20, 2000 at 6:08 PM
I've just scanned through a some of this new thread, and in particular I was reading the article email discuss on "To Bean or Not To Bean". In this sequence of mails the various participants, are working under the assumption that a Bean (besides meeting the get/set etc, naming conventions), must: a) Have a 0-arg constructor b) Be serializable. Was under the impression that having a 0-arg constructor was *not* a a strict requirement for a class to be a JavaBean. (But that most, Bean assembler environments (e.g BeanBox) currently, however, do require the 0-arg constructor. That is, that the 0-arg requirement was a limitation of existing Bean tools, not a requirement of the specification. I would be very interest to know if anyone can clear this issue up. (And if I am correct, to know how Bean tools might go about creating Beans when they don't have a 0-arg constructor). Thanks - PJL
Replies:
|