Tom,

        I echo your concerns. Our company uses the same basic components you
described, and then when the whole "EJB Buzz" started to pick up stream I was
tasked with evaluating whether or not EJB would be appropriate for some of
our projects. Now, I do not claim to have a good understanding of EJB, just a
moderate one ;) But here are some reasons why EJB is good:
        - If you are writing a large, enterprise class system, using EJB will result
in that system being built faster and more reliably. Because EJB includes
declarative middleware, like instance pooling, transactions, security, etc,
you don't have to write all that yourself. You get a nice team of people from
IBM or Oracle to do it for you.
        - You can encapsulate your business objects without mixing them in another
layer. This way your EJBs can be ported to other systems with different user
interfaces, for instance a thick client model.
        - You can sepperate your web layer and application layer, letting you
sepperate load, and also for security purposes (like having a firewall
between the application server and the web server).
        There are a lot of other pluses of course, for instance most tool vendors are
starting to ship their products with helpful wizards, etc that simplify some
of the work. Also, if you prefer to get your setup from one vendor, their
tools usually take care of a lot of the deploy work. I suggest you go buy a
book on EJB to see if its really worth it.
        Now, along with the positives, theres of course the negatives. EJB, in my
opinion, is this giant ugly monster. Its bloated, complicated, and expensive
for all but the biggest of our projects. Most websites are just pretty GUIs
wrapping a database, no need for EJB.

        I hope this gives you a little idea of EJB. Like I said, buying a book or
taking a short class on EJB will definatly help towards understanding it.

--
Branden Root
Senior Developer
Portent Interactive


On Monday 24 February 2003 10:51 am, you wrote:
> Hi all:
> I’ve been using TomCat, JSP, JavaBeans to talk to database servers via
> JDBC/ODBC and I feel I can do any Web/database related work with the tools
> I have, such as generating dynamic Web pages and storing/retrieving data
> from different database servers such as Oracle and SQL Server. I didn’t use
> any J2EE/EJB.
> Because it seems EJB is a hot topic and lots of people are using it, I
> studied a little about it. So far, I haven’t found any advantage of using
> it. In fact, I feel several disadvantages of using it:
>
> 1) You would have to use a heavy weight EJB application server such
> WebLogic or WebSphere, which are kind of more difficult to learn and
> certainly more expensive to buy than using just a light weight servlet/JSP
> engine like TomCat.
>
> 2) When you use EJB, you would have to follow the strict rules of
> programming, such as defining the interfaces for each EJB. With just using
> JavaBean, you don’t have this problem.
>
> 3) Each Entity Bean corresponds to a database table. When the database
> table is changed, such as adding/renaming/deleting columns, the
> corresponding EJB file would also have to be changed. Compared with using
> just a JavaBean to do the database work, the changes involved will be
> minimal - usually, just changing the SQL statements querying the table.
>
> 4) Deploying the EJB is certainly much more complicated than deploying the
> JSP/JavaBean files in TomCat. With the former, you have to go through all
> the steps creating the .jar, .war, .ear files and define the jndi names
> etc., while with the latter all you need to do is just drop the files into
> the correct folder.
>
> 5) With using the EJB, the .ear file created for one application server
> often doesn’t work with another application server (I tried to put the .ear
> file which works for one EJB application server onto another application
> server and it didn’t work. Other people had similar experiences like mine).
> I ended up having to re-create the .ear files for the new application
> server which cost me quite a bit of time. However, with using just a
> servlet engine, I would think you can just move the source code to the
> correct folders if you change the engine and it will work.
>
> 6) I heard people say “EJB provides almost transparent scalability”. What
> does        “scalability” mean exactly? Does it mean when the number of
> users of my application written using only JSP/JavaBean (without EJB)
> increases to a certain point, my application will run into the
> “scalability” trouble? If so, what kind of trouble is called “scalability”
> exactly?
>
> 7) Another advantage of EJB I heard was “transaction management”. Why do I
> need that? I can use JSP/JavaBean to issue all kinds of SQL statements and
> commit or rollback any transaction as needed. Why do I need EJB’s
> “transaction management”?
>
> 8) Another advantage of EJB I heard was “security”. My application
> currently uses username and passwords to authenticate users. If the user
> provide the correct username and password, then he/she can access the Web
> page. If not, then he/she cannot access the Web page. Is this kind of
> authentication inferior to the one EJB would provide?
>
> Having said above, my questions are:
>
> Is there anything EJB can do but using just JSP/JavaBean cannot? What are
> the advantages of using EJB compared with just using just JSP/JavaBean? Why
> are people so enthusiastic about using EJB? So far, I feel I can do
> anything without using EJB and I do feel using EJB just complicates the
> work unnecessarily. I’m sorry if my questions sound naive because my
> experience with using EJB is very limited. Thank you all for your answers
> to my questions in advance!
>
> Tom
>
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
>
> Some relevant archives, FAQs and Forums on JSPs can be found at:
>
>  http://java.sun.com/products/jsp
>  http://archives.java.sun.com/jsp-interest.html
>  http://forums.java.sun.com
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to