Spring and EJB have the same features?

Asked

Viewed 230 times

5

Spring and EJB have the same features?

If not, you can use both in the same application?

  • I recommend using CDI instead of Spring and REST services following an Microservices architecture instead of Ejbs. For newer products, these technologies are very advantageous.

  • I appreciate the tip, I’m following. Regards

1 answer

2

No, they have different purposes. Spring is a framework that works with dependency injection. The goal is to facilitate the creation of objects leaving it to specific providers and not to the classes that use the dependencies. The EJB is used for the development of projects using an architecture SOUNDS. Its object is to allow the implementation of functionalities as services. In this way, the systems become more modular and reusable, also facilitating continuous delivery per service. Both can be used in the same application, and even are very often.

  • "In the market is currently used more the CDI ". What is the source of this information? Both Spring and EJB (or better, Java EE) are very similar when the features they deliver: http://stackoverflow.com/a/29093892/2387977

  • http://blog.caelum.com.br/java-ee-versus-spring-resumendo-a-discussao/. One reference, but there are others.

  • Correct me if I’m wrong, but the link you put shows just the opposite: spring was more used. The article is also a little old, 2012. If you are going to take a newer chart (to do justice), using "CDI", the market showed more interest than in Spring 2012, but it has already been reached by Spring: http://www.indeed.com/jobtrends/q-java-and-ejb-q-java-and-spring-q-java-cdi-q-java-and-j2ee.html?relative1, probably by Spring 4 and its innovations. Still, the number of vacancies open does not seem reliable to me to know which is more used in the market.

  • This is an eternal discussion, it runs away from the scope of stackoverflow. The CDI is something emerging, if you apply in the market of legacy products spring and EJB will be on the rise. But for the future I don’t see this scenario lasting long.

  • I changed the answer so as not to allow for long debates.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.