We had the same discussion in work when we started using JSP.  While I was out
at JavaOne I was able to query one of the designers of the Java Bean spec, and
he stated to me that:
"Any class that has an empty constructor qualifies as a bean."
Anything else including getter/setter methods that aid in Reflection are useful,
but not required to be called a Bean.
Hope this helps...
gary...
--------------- Previous Memo History ---------------

To:  [EMAIL PROTECTED]
cc:
From: Schaeffer Rick <[EMAIL PROTECTED]>
Date:  07/09/99 12:43:50 PM




I'm afraid that I have no light to shed on Chris's problem.  The only thing
I can say is: I FEEL YOUR PAIN!  I too have been frustrated by the lack of a
clear understanding of what a bean is...even though I have successfully
implemented a couple of JSP "Beans".

Rick Schaeffer
([EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> )



        -----Original Message-----
        From:   Chris [SMTP:[EMAIL PROTECTED]]
        Sent:   Wednesday, July 07, 1999 10:31 PM
        To:     [EMAIL PROTECTED]
        Subject:        Beans? Really? Are you sure?

        Part II in what's threatening to be my Pedantic Bean Series . . .

        When I first read about JSP, and I found out that they use Beans
(not
        classes but Beans), I shit myself. Okay, no I didn't, but I was
        displeased because I actually have been a semi-successful freelance
Java
        coder since the week Java came out, and I've never written a Bean! I
        always got away with just classes. So I was gonna have to find out
        precisely what a Bean really was and how to actually write one from
        scratch with WinEdit.

        I went to Sun's site and downloaded various tutorials and white
papers
        and such (kind of a pain - most either didn't say anything or were
        poorly titled instructions on BeanBox - none seemed more recent than
        late 97), I came across the Bean Specification 1.0.1, and I read the
        whole damn thing.

        In it, a Bean is never precisely defined (it's a class, no wait,
it's an
        object. It "doesn't inherit from any class or interface", hold on,
it
        "must implement either Serializable or Externalizable". That was
        frustrating. Also irritating was the spec stressing that a Bean
        basically was a component that can be created and customized with a
        visual tool, and how there were plenty of things (like JDBC) that
were
        better off as Class Libraries and not Beans - in other words,
Everything
        Shouldn't Be a Bean. All well and good, but then JSP apparantly
decides
        everything MUST be a bean - even things that have no use
manipulation
        with a visual tool. So that seemed like a bad decision by the JSP
guys.

        So now I'm frustrated, I've read some stuff that annoyed me (not
hard),
        and I STILL don't really know what a bean is or how to write one. So
I
        decide I'll just look at Sun's source code examples that ship with
the
        JSWDK, and I'll follow their lead.

        And guess what?
        They're Not Beans!!!!!!!!!!

        They're just plain ol classes, the kind I actually know how to
write.

        Which brings me to the place I could have started from if I wasn't
        hamming it up . . .

        Does JSP really only work with Beans (and not just plain Jane
classes),
        and is the JSWDK just being nice (and if so what kind of a reference
        implementation is it? OR is there no Bean requirement at all - and
if
        that's true, how come JSP says there is (heck, it calls the tag
        'jsp:useBean")?

        All griping & insufferable garrulity aside, I would kind of like an
        answer.

         - Chris

        P.S. I STILL don't know how to write a bean


===========================================================================
        To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
        of the message "signoff JSP-INTEREST".  For general help, send email
to
        [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to