Thread: Java Beans???

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    I'll tell you if you tell me.
    Posts
    45
    Rep Power
    13

    Java Beans???


    I have just began to develope Java Beans. I bought the book by the Sun Press "Core Web Programming" and "JavaBeans". When I began developing the beans, I read that I needed a container for the beans. I downloaded and installed OpenEJB. It works great but it also has confused me. Are there different types of beans? If so, what are the differences? The reason I ask is that I can deploy some beans without using the OpenEJB container but some beans HAVE to have the container to run. I'm confused and I'd like some info. Thanks, Jeremy
    If you can't figure it out yourself, suck it up and ask someone else.

    DeveloperKB
  2. #2
  3. No Profile Picture
    Java Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    5
    Rep Power
    0
    Hi Scocby,

    Yes there are 2 sorts of beans

    1) Java Beans
    and
    2) Enterprise Java Beans (EJB)

    1) JavaBeans are usually just recepticles for data that you have aquired regarding the http request, and are used in the JSP page to form the dynamic sections of the response

    2) Enterprise Java Beans on the other hand come in 2 basic flavours. The first (session beans) of which is usually just a way to either store user session info, or facilitate frequently processed instructions. The second (entity beans) are a means of accessing a data source (i.e a MYSQL database)

    You are wanting to use the first of these. If you continue to persue java (particularly the J2EE side of it) then you will almost certainly come accross EJB at some point though. If I were you I'd forget about OpenEJB for the moment, at use tomcat or jetty, which are both very good and free.

    Hope this helps
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    I'll tell you if you tell me.
    Posts
    45
    Rep Power
    13
    I didn't think that Tomcat was an EJB container? I am already using Tomcat and that would explain the fact that my EJB are working when they shouldn't be. Thanks for your help, Jeremy
    If you can't figure it out yourself, suck it up and ask someone else.

    DeveloperKB
  6. #4
  7. No Profile Picture
    Java Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    5
    Rep Power
    0
    Just to clarify...you are using java beans (JB) which are supported by tomcat. You are not using Enterprise Java Beans (EJB), which are not supported tomcat. for EJB you need a container such as OpenEJB or JBoss. You will not want to use EJB so leave these alone
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    I'll tell you if you tell me.
    Posts
    45
    Rep Power
    13

    Thanks


    Thanks for your response. That's what I thought. Can you tell me what distinguishes a JavaBean from an Enterprise JavaBean? What makes them different? Also, what does an Enterprise JavaBean need that a JavaBean doesn't. I don't understand. Thanks for your help, Jeremy
    If you can't figure it out yourself, suck it up and ask someone else.

    DeveloperKB
  10. #6
  11. No Profile Picture
    Java Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    5
    Rep Power
    0
    It is a bit silly that EJB and JB are even both called beans in my opinion, as they are not closely linked at all in my opinion

    JB are used to make JSP more powerful and enable them to use data more effectively...as I'm sure you are learning

    EJB on the other hand are like services that can be attacthed to and perform a task, such as a calculation, some database access or something else, and then are disconnected from. They are often used in distributed (i.e. using more than one machine) system. Or to give all services a common point of entry

    Hope this makes sense
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    I'll tell you if you tell me.
    Posts
    45
    Rep Power
    13

    Thanks


    Thanks a bunch. I understand a bit more now. Thanks again, Jeremy
    If you can't figure it out yourself, suck it up and ask someone else.

    DeveloperKB

IMN logo majestic logo threadwatch logo seochat tools logo