Spring Design Philosophy
When you learn about a framework, it’s important to know not only what it does but what principles it follows. Here are the guiding principles of the Spring Framework:
当学习一个框架,最重要的事情不仅是搞清楚它能干什么,而且需要搞清楚它遵循的原则。下面是Spring框架的指导原则:
Provide choice at every level. Spring lets you defer design decisions as late as possible. For example, you can switch persistence providers through configuration without changing your code. The same is true for many other infrastructure concerns and integration with third-party APIs.
【在每一层提供选择权。】Spring可以让你尽可能的推迟决定设计方案。例如,你可以通过配置而无需修改代码即可替换持久层,对于其他关注的基础组件和第三方API也是一样。
Accommodate diverse perspectives. Spring embraces flexibility and is not opinionated about how things should be done. It supports a wide range of application needs with different perspectives.
【包容多样性的处理问题方式。】Spring拥抱变化和灵活性,对于事情应该如何做并不是固执己见。它提供广泛的应用使用不同的解决方案。
Maintain strong backward compatibility. Spring’s evolution has been carefully managed to force few breaking changes between versions. Spring supports a carefully chosen range of JDK versions and third-party libraries to facilitate maintenance of applications and libraries that depend on Spring.
【保持健壮的向后兼容性。】Spring的升级在管理版本间差异时非常小心,Srping对于JDK版本支持和第三方库维护的应用以及依赖Spring的库提供严谨的版本选择。
Care about API design. The Spring team puts a lot of thought and time into making APIs that are intuitive and that hold up across many versions and many years.
【关注API设计。】Spring团队花费很多精力和时间来设计API,靠着直觉,也一直贯彻了很多个版本很多年。
Set high standards for code quality. The Spring Framework puts a strong emphasis on meaningful, current, and accurate javadoc. It is one of very few projects that can claim clean code structure with no circular dependencies between packages.
【高标准的代码质量。】Spring框架对javadoc的意义、更新、精确性非常重视。非常少有的工程会把代码结构声明的如此清晰,包之间没有循环依赖。