OSGi vs Spring vs Struts vs EJB vs. Hibernate -- a totally newbie's question

sean picture sean · Aug 26, 2010 · Viewed 12.7k times · Source

I am not familiar with these "framework" "components" at all, but can someone give me a 101 introduction about what the relationship they are to each other? Basically, I want to know roughly about:

  1. what and what are counterparts to each other

  2. what and what are complementary technology (e.g., A as a framework can be used with B as a component)

  3. what big names have I missed above list which I should not have?

Can anyone give me a high level intro? After reading the first two answers, can someone give more explanation about Spring vs. OSGi -- are they in separate market (Enterprise vs. Mobile)?

Many thanks

Answer

Bozho picture Bozho · Aug 26, 2010

The "vs" is incorrect, because many of these can be used together.

  • OSGi is a modularization technique (rather than a framework). It gives you the ability to separate your software in independent modules that can co-exist in different versions, with and without other modules

  • Spring - lightweight dependency injection container. It allows you to wire your components by defining their dependencies and letting the framework instantiate and configure them, thus allowing for greater flexibility (couldn't say more buzzwords here).

  • Struts - an MVC, action-based framework - used in the web tier

  • EJB - The business componnets of JavaEE - you place your business logic in Enterprise JavaBeans, and you have transaction handling, state handling, (JMS) message consumption, timers, etc out of the box

  • Hibernate - an ORM (object-relational mapping) solution - basically it allows you to work with objects (oop) when you have a relational database as a data storage.