JavaBeans are reuseable components. That seems a good enough reason
as any to me. For example, lets say you have a server with a database
running on it, with various information about customers. You have already
written an application in Java that uses a bean to query the database and
provide some information. Suddenly, your specification changes and it needs
to be accessible from the web. With JSP, you can use the same bean as the
application does to access the database, usually with little or no code
change. And vice versa for converting a web-based app to a standard app.
        Converting the standard app into a servlet would usually take
longer. Ok, so most of the code can be reused, you still need to copy and
paste it into the right places in the servlet, perform testing to ensure
that everything is done right, etc. With beans, you know that the bean works
and will work whether you call it from a JSP, or from a standard
application.

Dave


> -----Original Message-----
> From: O'Keeffe Patrick [mailto:Patrick_O'[EMAIL PROTECTED]]
> Sent: 13 September 1999 10:16
> To: [EMAIL PROTECTED]
> Subject: Why use JavaBeans?
>
>
> Hi,
>
> I'm an ASP developer who is trying to put forward a case for using the
> JSP/Servlet/JavaBean approach. I'd be very grateful if
> someone could explain the
> following to me:
>
> What is the advantage of using JavaBeans with servlets and
> JSPs when the same
> result could be obtained by chaining servlets and JSPs? Both
> approaches separate
> content from presentation. Granted, the latter places more
> strain on the web
> service, but is there some other argument for involving JavaBeans?
>
> This might be a basic question, but any elaboration would be greatly
> appreciated.
>
> Many thanks,
>
> Patrick O'Keeffe
> Consultant

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to