我应该选择Spring还是坚持使用Java EE 6? [英] Should I go for Spring or stick with Java EE 6?

查看:76
本文介绍了我应该选择Spring还是坚持使用Java EE 6?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将完成核心Java课程,现在我必须继续 Java EE 方面。
我非常困惑,我应该简单地使用Java EE 6,因为我的书很容易从头到尾教,一切都在那里。



或者我应该从春季开始?



<因为我必须从头开始,所以我遵循良好且更注重工作的趋势。



或者即使我只做Java EE然后如果我需要继续使用Spring,它会很快,反之亦然。



Hibernate 站在他们之间?我的意思是,如果我使用Java EE 6,我是否还需要Hibernate或Java EE 6,我不需要它。



如果我是否处于不利地位不使用Spring或Spring可以使我的构建Web应用程序比核心Java EE / JSF framework。

解决方案

虽然你的问题表明Spring和Java EE是两回事,但事实上并非如此。您可以使用许多Java EE组件,例如




  • 用于Spring MVC的servlets和JSP,

  • JPA

  • JTA for Spring security



Spring在Java EE堆栈中替换的唯一主要内容是 EJB 。除非你坚持使用EJB,否则Spring应该是可行的方法。此外,Spring还为Web服务和其他内容提供内置支持。



还要检查 Groovy Grails 以Spring为基础。



最后我要说的是,功能明智都是一样的。这是代码(Java EE)与配置(Spring),实际上是一个偏好的问题。


I will be finishing the core Java course and now I have to move on to Java EE side. I am so much confused that I should simply go with Java EE 6 because I have the books which easily teach from start to end and everything is there.

Or should I start with Spring only?

Because as I have to start from scratch it is good I follow the trend which is good and more job oriented.

Or even if I do Java EE only and then if I need to move on to Spring it will be fast or vice versa.

Also where does Hibernate stand between them? I mean if I use Java EE 6, do I still need Hibernate or in Java EE 6, I don't need it.

Will I be at a disadvantage if I don't use Spring or Spring can make my building web application any way easier than the core Java EE/ JSF framework.

解决方案

Though your question suggests that Spring and Java EE are two different things, in reality they are not. You can use many Java EE components like

  • servlets and JSP for Spring MVC,
  • JPA for Spring DAO.
  • JTA for Spring security

The only major thing Spring replaces in the Java EE stack is the EJB. Unless you insist on using EJBs, Spring should be the way to go. Also Spring provides inbuilt support for webservices and other things as well.

Also checkout the Groovy and Grails that use Spring as the base.

Finally I would say, functionality wise both does the same. It's code (Java EE) vs configuration (Spring), a matter of preference really.

这篇关于我应该选择Spring还是坚持使用Java EE 6?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆