Differences & advantages of Spring/Struts/EJB/Hibernate?

Hi, I used to program EJB's about 8 years ago but have not done so since. I've been refamiliarizing myself with Java & it's technologies lately and have come across Struts, Spring, & hibernate as alternatives to/and even additions to EJB in some cases.

What I'd like to know (Each website I look at on each technology just states why it is better than the other etc...)

- What are the differences (in plain english) between EJB's, Struts, Spring, and Hibernate.
- When would one use one of the technologies instead of the others.
- When is it likely that they would be used together?
- What are the advantages of each of them over each other?
- In deciding on which of them to use is it often based on current/previous technologies a company may use or is there another factor that helps to decide this?

>> What are the differences (in plain english) between EJB's, Struts, Spring, and Hibernate.

1. EJBs are part of the JEE specifications, they are server side components where you keep your business logic. The implementation takes car of transactions, security, concurrency, remote procedure calls (RMI), web services, etc. Read more here: http://en.wikipedia.org/wiki/Ejb

From my experience they are very usefull and I never had any bigger problems using them for their intented use. We use them havily in our projects.

The basic difference between the EJBs from 8 years ago is that they are much easier to handle now and there are no Entity Beans left (replaced by JPA).

4. Hibernate is object relational mapping tool. You can use that in combination with any of the above technologies.

>> When would one use one of the technologies instead of the others.

You should only decide which MVC to use, but here not only Spring and Struts are available, there are many more. We use Seam.

If you plan to use a OR mapping tool, then Hibernate is by far the most popular and very evolved.

>> When is it likely that they would be used together?

It is very likely that EJBs, Hibernate and one of the frameworks are used in combination in a serious web application. If the client side is desktop, then you might not need Spring or any other web framework.

We use the combintaion: EJBs, Hibernate, JSF, Seam.

>> What are the advantages of each of them over each other?

You can only really compare Spring and Struts, where Spring has many modules that Struts dont.

>> In deciding on which of them to use is it often based on current/previous technologies a company may use or is there another factor that helps to decide this?

Yes. Good knowledge of all the involved technologies is crucial, especially when forming a new large project. In my opinion the most important factor is your crew and the experience and knowledge they have. I would never start an important project without having a smaller project demonstrating all the involved technologies.

0

Featured Post

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …