hi -

        <cross-posting to servlet-interest as i feel it
        is a relevant topic>

        i'd like to add an extremely easy to parse statement
        mark hapner (j2ee architect) provided the other day
        on this very topic:

An EJB implements a distributed, transactional, multi-user 'service'.

A JavaBean is a Java class that obeys a set of conventions that allow an
IDE to visually create, customize and link individual bean instances
together at development time to build larger blocks of regular Java
logic. JavaBeans allow developers to program visually instead of with a
source editor.

A JavaBean is roughly equivalent to a Visual Basic control and an EJB is
roughly equivalent to a Microsoft Transaction server component.

Some JavaBeans are 'visible' meaning that they present themselves via a
GUI when they execute. An example is a button or list box JavaBean.

Some JavaBeans are 'invisible' meaning that they have no visible
representation when they execute. An example is a JavaBean that
implements a parametric SQL query where the SQL is defined at design
time (typically using a graphical editor supplied with the JavaBean that
allows the SQL to be defined visually) and the parameters are supplied
via values feed to the customized bean instance at execution time.

Since the Java code in EJBs is normal single-user code, it is quite
likely that some of this code will be developed visually using IDE's.
Such code will be built with invisible JavaBeans such as the parametric
query bean noted above.

So, although EJB's and JavaBeans are quite different, they can also be
used together.

-- Mark

        hope this helps,

- james

Carles Pi-Sunyer wrote:
>
> To follow up on what Kevin said. JavaBeans and EJB (Enterprise
> JavaBeans) really have nothing to do with each other. They only share
> two things: both have the word Bean in their names, and both impose a
> component like model on a programming problem.
>
> I suspect that one of the reasons that JSP uses JavaBeans is to
> encourage the future development of visual page design tools that allow
> drag and drop JavaBean integration into JSP. Right now there are none,
> but I can imagine a tool like Dreamweaver having it in the future. The
> whole process may become even more likely after the 1.1 spec is
> implemented.
>
> As far as the programming models go, one possibility for enterprise
> class applications is: JSP->JavaBean->EJB->DBMS. The JavaBeans would
> handle the interaction with the EJBs and encapsulate the results for the
> JSP. The problem with this approach is cost. EJB servers are pretty
> expensive. For a simpler application, database interaction can be
> managed in servlets or JavaBeans. This kind of system can be deployed
> for a much lower cost.
>
> Carles
>
> > Kevin Jones wrote:
> >
> > Don't you just hate marketing!!
> >
> > A 'bean' is a Java component that follows certain loosely defined
> > rules - mainly that it has a default (no-args) constructor, and that
> > it may have set/get methods for its properties. Any java class that
> > follows these rules can be thought of as a 'bean'. So beans have
> > nothing really to do with UI development, although they were
> > introduced originally as an alternative to ActiveX controls to allow
> > developers to have drag and drop java development environments similar
> > to VB in the Microsoft world.
> >
> > Enterprise Java Beans are an entirely different thing - EJB is used on
> > the server as a way of easing the pain of developing distributed
> > applications. If you write an EJB application things like
> > transactions, database connection pooling and threading are taken care
> > of for you. EJBs are most likely to be used for server-side code that
> > needs transacted data-base access. In Sun's Application Programming
> > Model (APM) the idea is that we use HTML for the fron end,
> > Servlets/JSP in the middle tier and EJBs at the server, with the
> > servlets talking to the EJBs and the EJBs managing all the data.
> >
> > Kevin
> >  -----Original Message-----
> > From: A mailing list about Java Server Pages specification and
> > reference [mailto:[EMAIL PROTECTED]]On Behalf Of Elena Palanca
> > Sent: 28 July 1999 11:05
> > To: [EMAIL PROTECTED]
> > Subject: JavaBeans vs. Enterprise JavaBeans
> >
> >      Dear all,
> >      I'm newbi in JavaBeans and I'm thinking that I'm using them
> >      in the wrong way.
> >      From what I know the  JavaBeans is a component model for
> >      visual construction of reusable components for the Java
> >      platform.While Enterprise JavaBeans
> >      extends JavaBeans to middle-tier/server side business
> >      applications. The extensions that Enterprise JavaBeans adds
> >      to  JavaBeans include support for transactions, state
> >      management, and deployment time attributes.
> >      In my application (intranet/extranet) I started to work with
> >      JavaBeans as simply containers of some type of information
> >      (databeans), without any visual interface so I used them as
> >      server-side containers. After some readings on EJB I think
> >      that the way I'm using JavaBeans is wrong, should be better
> >      in my case  to use  EJB?
> >      If yes, is there someone who could give me some fast
> >      information to use them, (the configuration  I have to
> >      support to work with them, IDE, some internet sites where I
> >      can find information, etc.)
> >      Thanks
> >      Elena
> >
>
> ===========================================================================
> 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