没有合适的资源?快使用搜索试试~ 我知道了~
spring框架外文文献.docx
需积分: 50 76 下载量 198 浏览量
2020-07-08
13:43:31
上传
评论 11
收藏 1.66MB DOCX 举报
温馨提示
试读
25页
毕业论文外文文献+中文翻译,选取spring框架外文文献并进行相应翻译。 The Spring Framework evolved from the code written for Expert One-on-One J2EE Design and Development by Rod Johnson (Wrox, 2002). The framework combines best practices for Java Enterprise Edition (JEE) development from the industry and integration with the best-of-breed third-party frameworks. It also provides easy extension points to write your own integration if you need one that doesn’t yet exist. The framework was designed with developer productivity in mind, and it makes it easier to work with the existing, sometimes cumbersome Java and JEE APIs.
资源推荐
资源详情
资源评论
附录
一、英语原文
Spring Framework Fundamentals
The Spring Framework evolved from the code written for Expert One-on-One J2EE
Design and Development by Rod Johnson (Wrox, 2002). The framework combines best
practices for Java Enterprise Edition (JEE) development from the industry and integration
with the best-of-breed third-party frameworks. It also provides easy extension points to write
your own integration if you need one that doesn’t yet exist. The framework was designed with
developer productivity in mind, and it makes it easier to work with the existing, sometimes
cumbersome Java and JEE APIs.
Before we start our journey into Spring MVC and Spring Web Flow, we will provide a
quick refresher
course on Spring Core (formerly known as the Spring Framework). Spring is now a longtime
de-facto
standard for Java enterprise software development. It introduced many of us to concepts such
as dependency injection, aspect-oriented programming (AOP), and programming with plain-
old-Java-objects (POJOs).
In this chapter, we will cover dependency injection and AOP. Specifically, we will cover
how the Spring Framework helps us implement dependency injection and how to use
programming to our advantage. To be able to do the things mentioned here, we will explore
the Inversion of Control (IoC) container; the application context.
We will only touch on the necessary basics of the Spring Framework here. If you want
more in-depth information about it, we suggest the excellent Spring Reference guide
(www.springsource.org) or books such as Pro Spring 3 (Apress, 2012) or Spring Recipes, 2nd
Edition (Apress, 2011).
Let’s begin by taking a quick look at the Spring Framework and the modules that
comprise it.
Spring Framework
In the introduction, we mentioned that the Spring Framework evolved from code written for
the book Expert One-on-One J2EE Design and Development by Rod Johnson. This book was
written to explain some of the complexities in JEE and how to overcome them. And while
many of the complexities and problems in JEE have been solved in the newer JEE
附录
specifications (especially since JEE 6), the Spring Framework remains very popular.
It remains popular due to its simple (not simplistic!) approach to building applications. It
also offers a consistent programming model for different kinds of technologies, be they for
data access or messaging infrastructure. The framework allows developers to target discrete
problems and build solutions specifically for them.
The framework consists of several modules (see Figure 2-1) that work together and build
on each other. We can pretty much cherry pick the modules we want to use.
Figure 2-1. Overview of the Spring Framework
All of the modules from Figure 2-1 are represented as jar files that we can include on the
classpath if we need a specific technology. In Table 2-1, we list all the modules coming with
Spring 3.1 and give a brief description of the content of each module, as well as any artifact
names that might be used for dependency management. The name of the actual jar file might
differ, depending on how one obtains the module. The downloadable distribution contains jars
in this form: org.springframework.[module- name]-[version].jar. Jars that come from the
maven repositories use this form: spring-[artifact].jar. See table 2-1.
Table 2-1. The Spring Framework Module Overview
附录
Most of the modules have a dependency on some other module in the Spring Framework.
The core module is an exception to this rule. Figure 2-2 gives an overview of the commonly
used modules and their dependencies on other modules. Notice that the instrumentation,
附录
aspect, and test modules are missing from the figure; this is because their dependencies
depend on the project and what other modules are used. The Spring Framework has only one
required dependency: commons-logging, a logging abstraction framework. The other
dependencies differ based on the needs of the project.
Dependency Injection
The concept of dependency injection (DI), objects are given their dependencies at
construction time, is one of the foundations of the Spring Framework. You have also probably
heard of Inversion of Control (IoC). IoC is a broader, more general concept that can be
addressed in different ways. IoC lets developers decouple and focus on what is important for a
given part of an enterprise application, but without having to think about what other parts of
the system do. Programming to interfaces is one way to think about decoupling.
Almost every enterprise application consists of multiple components that need to work
together. In the early days of Java enterprise development, we simply put all the logic of
constructing those objects (and the objects those objects needed) in the constructor (see
Listing 2-1). At first sight, there is nothing wrong with that approach; however, as time
progressed, object construction became slow, and objects had a lot of knowledge they
shouldn’t have had (see the Single Responsibility Principle). Those classes became hard to
maintain, and they were also quite hard to unit and/or integration test.
附录
The class from Listing 2-1 programs to interfaces, but it still needs to know about the
concrete implementation of an interface simply to do object construction. Applying IoC by
decoupling the construction logic (collaborating objects) makes the application easier to
maintain and increases testability. There are seven ways to decouple this dependency
construction logic:
1. Factory pattern
2. Service locator pattern
3. Dependency injection
a. Constructor based
b. Setter based
c. Interface based
d. Annotation driven
4. Contextualized lookup
剩余24页未读,继续阅读
资源评论
Cy_2024
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功