我应该学习Spring 2还是3?

时间:2021-08-07 06:02:39

Spring Framework 3 seems to be right around the corner, but the GA version is 2.5.6.

Spring Framework 3似乎即将到来,但GA版本为2.5.6。

If this is the first time I'm approaching the subject, should I start with the stable version, or should I start with the new version and save myself migration issues?

如果这是我第一次接触这个主题,我应该从稳定版本开始,还是应该从新版本开始并保存自己的迁移问题?

How different is version 3 from version 2? How near is Spring 3?

版本3与版本2有何不同?春天3有多近?

7 个解决方案

#1


I would start with the stable version. Less bugs, more documentation, more stable and easier to find answers to issues.. Spring 3 won't be vastly different. There is a Spring 3 reference manual but it's incomplete for the changes. Also, since Spring 3 is only on a milestone release (M3), it's still subject to change.

我会从稳定版开始。更少的错误,更多的文档,更稳定,更容易找到问题的答案。春季3将不会有太大的不同。有一个Spring 3参考手册,但它对于更改并不完整。此外,由于Spring 3仅在里程碑发布(M3)上,它仍然可能会发生变化。

You can read What's New in Spring 3.0 but I imagine a lot of it won't mean anything to you yet.

你可以阅读Spring 3.0中的新功能,但我想很多它对你来说没什么意义。

#2


I would start with Spring 3 for various reasons:

我将从Spring 3开始出于各种原因:

  • full Java 5 support (this is main reason for adopting Spring 3 for me)
  • 完整的Java 5支持(这是我采用Spring 3的主要原因)

  • Spring MVC support is deeply change between spring 2 and 3 (notably REST support). Learning spring 2 MVC is not a far-seeing imho.
  • Spring MVC支持在Spring 2和3之间发生了深刻的变化(特别是REST支持)。学习spring 2 MVC并不是一个很好看的人。

  • new module organization (if you start with Spring 3, you don't need to migrate packages in the future)
  • 新模块组织(如果从Spring 3开始,将来不需要迁移软件包)

  • OSGI compabitiliy
  • Ivy support

You don't need to worry about bugs or incomplete documentation since you are still learning the framework concepts. In conclusion, learning Spring 3 instead Spring 2 is a far-seeing choice.

您不需要担心错误或不完整的文档,因为您仍在学习框架概念。总之,学习Spring 3而不是Spring 2是一个很好的选择。

However a very good introduction to Spring 2.x is given by Spring in Action, an excellent book about the subject.

然而,Spring in Action给出了Spring 2.x的一个非常好的介绍,这是一本关于这个主题的优秀书籍。

#3


It's important to know required java language version:

了解所需的java语言版本非常重要:

  • Spring 3 needs java 1.5
  • Spring 3需要java 1.5

  • Spring 2.5 needs java 1.4
  • Spring 2.5需要java 1.4

  • Spring 2.0 and older works on java 1.3 (if you still work on legacy servers, I recently used Spring 2.0 on WAS 5.0)
  • Spring 2.0及更早版本适用于java 1.3(如果您仍在旧版服务器上工作,我最近在WAS 5.0上使用了Spring 2.0)

#4


Start with Spring 2 for the simple reason that if you are doing a project right now, it will be in Spring 2 and not Spring 3. I've been exploring Spring 3 for a while but working in Spring 2 and have to say that they have added a lot of nice new features in Spring 3.

从Spring 2开始,原因很简单,如果你现在正在做一个项目,那将是在Spring 2而不是Spring 3.我一直在探索Spring 3,但在Spring 2工作并且不得不说他们在Spring 3中添加了许多不错的新功能。

This actually makes working in Spring 2 annoying because I look for the things and they aren't there. It's a little annoying - spare yourself this, I don't think you'll have any trouble learning Spring 3.

这实际上使得在Spring 2中工作很烦人,因为我寻找的东西并不存在。这有点烦人 - 不用这个,我不认为你在学习Spring 3时会遇到任何麻烦。

#5


If you're learning it to start a new project that's going to be starting when Spring 3 is out learn Spring 3. If you're going to be working on an existing project that's already on Spring 2, learn that. The changes are significant enough that projects currently using 2.x are not going to jump immediately.

如果你正在学习如何开始一个新的项目,那就是在Spring 3出来的时候开始学习Spring 3.如果你打算在Spring 2上已经有一个现有的项目,那就去学习吧。这些变化非常重要,目前使用2.x的项目不会立即跳转。

#6


I wouldn't worry too much about the version; probably starting with the actual release (i.e. 2) is better than starting with one that's still in milestone releases. However, Spring 2.5, and particularly Spring MVC, can use two approaches; configuring primarily using XML, or configuring primarily using annotations. Spring is definitely moving in the direction of annotations, so if you get used to using them you should be OK.

我不会太担心版本;可能从实际版本开始(即2)比从仍在里程碑版本中的版本开始更好。但是,Spring 2.5,特别是Spring MVC,可以使用两种方法;主要使用XML进行配置,或主要使用注释进行配置。 Spring肯定会朝着注释的方向发展,所以如果你习惯使用它们,你应该没问题。

#7


It is possible use xml configuration and annotations in the same project.

可以在同一个项目中使用xml配置和注释。

I've made some project in 2.5 but now would like move to Spring 3.

我在2.5中做了一些项目,但现在想转到Spring 3。

I understand that is not easy (it is not enough only change library - need re-write code).

我明白这并不容易(仅仅改变库是不够的 - 需要重新编写代码)。

#1


I would start with the stable version. Less bugs, more documentation, more stable and easier to find answers to issues.. Spring 3 won't be vastly different. There is a Spring 3 reference manual but it's incomplete for the changes. Also, since Spring 3 is only on a milestone release (M3), it's still subject to change.

我会从稳定版开始。更少的错误,更多的文档,更稳定,更容易找到问题的答案。春季3将不会有太大的不同。有一个Spring 3参考手册,但它对于更改并不完整。此外,由于Spring 3仅在里程碑发布(M3)上,它仍然可能会发生变化。

You can read What's New in Spring 3.0 but I imagine a lot of it won't mean anything to you yet.

你可以阅读Spring 3.0中的新功能,但我想很多它对你来说没什么意义。

#2


I would start with Spring 3 for various reasons:

我将从Spring 3开始出于各种原因:

  • full Java 5 support (this is main reason for adopting Spring 3 for me)
  • 完整的Java 5支持(这是我采用Spring 3的主要原因)

  • Spring MVC support is deeply change between spring 2 and 3 (notably REST support). Learning spring 2 MVC is not a far-seeing imho.
  • Spring MVC支持在Spring 2和3之间发生了深刻的变化(特别是REST支持)。学习spring 2 MVC并不是一个很好看的人。

  • new module organization (if you start with Spring 3, you don't need to migrate packages in the future)
  • 新模块组织(如果从Spring 3开始,将来不需要迁移软件包)

  • OSGI compabitiliy
  • Ivy support

You don't need to worry about bugs or incomplete documentation since you are still learning the framework concepts. In conclusion, learning Spring 3 instead Spring 2 is a far-seeing choice.

您不需要担心错误或不完整的文档,因为您仍在学习框架概念。总之,学习Spring 3而不是Spring 2是一个很好的选择。

However a very good introduction to Spring 2.x is given by Spring in Action, an excellent book about the subject.

然而,Spring in Action给出了Spring 2.x的一个非常好的介绍,这是一本关于这个主题的优秀书籍。

#3


It's important to know required java language version:

了解所需的java语言版本非常重要:

  • Spring 3 needs java 1.5
  • Spring 3需要java 1.5

  • Spring 2.5 needs java 1.4
  • Spring 2.5需要java 1.4

  • Spring 2.0 and older works on java 1.3 (if you still work on legacy servers, I recently used Spring 2.0 on WAS 5.0)
  • Spring 2.0及更早版本适用于java 1.3(如果您仍在旧版服务器上工作,我最近在WAS 5.0上使用了Spring 2.0)

#4


Start with Spring 2 for the simple reason that if you are doing a project right now, it will be in Spring 2 and not Spring 3. I've been exploring Spring 3 for a while but working in Spring 2 and have to say that they have added a lot of nice new features in Spring 3.

从Spring 2开始,原因很简单,如果你现在正在做一个项目,那将是在Spring 2而不是Spring 3.我一直在探索Spring 3,但在Spring 2工作并且不得不说他们在Spring 3中添加了许多不错的新功能。

This actually makes working in Spring 2 annoying because I look for the things and they aren't there. It's a little annoying - spare yourself this, I don't think you'll have any trouble learning Spring 3.

这实际上使得在Spring 2中工作很烦人,因为我寻找的东西并不存在。这有点烦人 - 不用这个,我不认为你在学习Spring 3时会遇到任何麻烦。

#5


If you're learning it to start a new project that's going to be starting when Spring 3 is out learn Spring 3. If you're going to be working on an existing project that's already on Spring 2, learn that. The changes are significant enough that projects currently using 2.x are not going to jump immediately.

如果你正在学习如何开始一个新的项目,那就是在Spring 3出来的时候开始学习Spring 3.如果你打算在Spring 2上已经有一个现有的项目,那就去学习吧。这些变化非常重要,目前使用2.x的项目不会立即跳转。

#6


I wouldn't worry too much about the version; probably starting with the actual release (i.e. 2) is better than starting with one that's still in milestone releases. However, Spring 2.5, and particularly Spring MVC, can use two approaches; configuring primarily using XML, or configuring primarily using annotations. Spring is definitely moving in the direction of annotations, so if you get used to using them you should be OK.

我不会太担心版本;可能从实际版本开始(即2)比从仍在里程碑版本中的版本开始更好。但是,Spring 2.5,特别是Spring MVC,可以使用两种方法;主要使用XML进行配置,或主要使用注释进行配置。 Spring肯定会朝着注释的方向发展,所以如果你习惯使用它们,你应该没问题。

#7


It is possible use xml configuration and annotations in the same project.

可以在同一个项目中使用xml配置和注释。

I've made some project in 2.5 but now would like move to Spring 3.

我在2.5中做了一些项目,但现在想转到Spring 3。

I understand that is not easy (it is not enough only change library - need re-write code).

我明白这并不容易(仅仅改变库是不够的 - 需要重新编写代码)。