Reputation: 4609
I just took a class on Enterprise Web Development with JAVA, and we built an application that used Enterprise Java Beans. I'm trying to improve my understanding of EJB's, and was thinking about the advantages of using EJB's.
For our application, we injected an EJB into our servlets. The EJB's talked to the business logic tier (which was deployed as a jar). I was thinking about what the advantage is of using an EJB, instead of just having the servlet interact directly with the business tier JAR.
I came up with 2 reasons:
1) The EJB's allow you to construct the application in a modular fashion, since each EJB can be responsible for certain categories of back-end responsibility.
2) Since the EJB's are deployed to the EJB container, they can be looked up via their JNDI name, and so if other applications are deployed on the server, and have the need to perform similar functions, they can take advantage of the EJB's that are already present on the server.
Am I on the right track? Do EJB's provide more advantages than that? I know that MDB's are used in conjunction with the JMS API, but I'm more looking at session beans.
Upvotes: 0
Views: 755
Reputation: 308753
That's fine, but you need to recognize a few things:
It's great that you're learning, but don't be fooled into thinking you've reached the top of the food chain. The rest of the world is going in the direction of HTTP web services, not EJBs.
Upvotes: 2