From Spring in Action 4th
最近在看《From Spring in Action 4th》有的英文字句读着特别舒服,遂想记录一下
Chapter1:
decoupled 解耦
couple 耦合
object-relational mapping (ORM映射)
asynchronous 异步的
Model-View-Controller (MVC)
Once the bean is no longer in use, it’s eligible for garbage collection and eventually goes to the big bit bucket in the sky.
When it comes to Spring, there’s more than meets the eye.
mechanism 机制,原理
bulk 大多数
ubiquitous[juː'bɪkwɪtəs] 普遍存在的
aspect-oriented programming 面向切面编程
Without further ado, let’s move on to chapter 2 to learn how to wire objects together in Spring using DI.
Chapter2:
collaborate with 合作
demonstrate 证明,论证
wiring 装配
is annotated with 被注解
Believe it or not, with only two classes created, you already have something that you can try out.
trade-off 交换,交易
All beans in a Spring application context are given an ID.
derived from 来源于
subtle 微妙的,敏感的
interchangeable 可交换的
Put succinctly 简单地说
ambiguity 含糊,不明确
to be certain 肯定
business logic 业务逻辑
/*
Unleashing your imagination a bit, you might do something crazy like randomly selecting a CompactDisc from a selection of choices:
*/
@Bean
public CompactDisc randomBeatlesCD() {
int choice = (int) Math.floor(Math.random() * 4);
if (choice == 0) {
return new SgtPeppers();
} else if (choice == 1) {
return new WhiteAlbum();
} else if (choice == 2) {
return new HardDaysNight();
} else {
return new Revolver();
}
}
The possibilities are limited only by the capabilities of the Java language.
reducing verbosity 减少冗余
But it’s also less powerful than JavaConfig,
where you can do almost anything imaginable to arrive at the bean instance.
nevertheless 然而,不过如此
verbose[vɜː'bəʊs] 啰嗦的
alternatively adv. 二选一的
aside from 除...以外
for the sake of 为了
break down 分解
be obligated to 有责任去做
occasionally 偶尔,间或
regardless of 不管
As it turns out, the answer isn’t intuitive.
Chapter 3:
You won’t get as much day-to-day use out of the
techniques in this chapter, but that doesn’t mean they’re any less valuable.
arbitrary 任意的
in conjunction with 共同
delegate to 把...委托给(代理人xx或代表)
Then we’ll take a deeper dive into some of SpEL’s primitive expressions that can be pieced together into more powerful expressions.
stripping away 剥离掉
ternary operator 三元运算符
wrap up 包装,圆满完成
The more clever your expressions become, the more important it will be to test them.
Chapter 4:
There’s little we can do to avoid paying for a
cool and comfortable home.
The term classic usually carries a good
connotation. Classic cars, classic golf tourna- ments, and classic Coca-Cola are all good things.
fine-grained 细粒度的
declarative 声明式的
Before you walk the walk, you have to learn to talk the talk.
Likewise, orand not can be used in place of || and !, respectively.
A performance isn’t a performance without an audience. Or is it? When you thinkabout it from the perspective of a performance, an audience is important but isn’tcentral to the function of the performance itself; it’s a separate concern. Therefore, itmakes sense to define the audience as an aspect that’s applied to a performance.
But if the performancefails to meet the audience’s expectations, then the audience should demand a refund(demandRefund()).
It’s a shame that you had to repeat that same pointcut
expression four times.Duplication like this doesn’t feel right.
It’d be nice if you could define the pointcutonce and then reference it every time you need it.
is identical to 与...相同...