Spring-揭秘书籍--再揭秘

本文对比分析了《Spring揭秘》与Pro Spring的内容相似性,指出《Spring揭秘》部分章节几乎直接翻译自Pro Spring,并探讨了这种做法是否构成学术造假。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

  闲暇无聊 也很久没有 看spring

 

  听说中国巨子写了spring 揭秘 幸福 因为作者 最早在 网上的那几篇我觉得不错;

 

 就china-pub下载了第九章看了看

 

 不看不知道 ,看了吓一跳

 

 怎么这样熟悉,和我讲课一样

 

 在想 我讲课参考的是pro spring

 

 我进行了spring揭秘第九章 与 pro spring对比

 

 感叹!

 

 连类名都一样!StopWatch

 

整个第九章 几乎 完全可以从pro spring 整段看到

 

感觉前2,3章不错,估计是作者用心了

后面就开始 糊弄了

 

 public interface MethodMatcher {
boolean matches(Method m, Class targetClass);
boolean isRuntime();
boolean matches(Method m, Class targetClass, Object[] args);
}
Spring supports two different types of MethodMatcher, static and dynamic, determined by the
return value of isRuntime(). Before using a MethodMatcher, Spring calls isRuntime() to determine
whether the MethodMatcher is static, indicated by a return value of false, or dynamic, indicated by
a return value of true.
For a static pointcut, Spring calls the matches(Method, Class) method of the MethodMatcher
once for every method on the target, caching the return value for subsequent invocations of those
methods. In this way, the check for method applicability is performed only once for each method
and subsequent invocations of a method do not result in an invocation of matches().
With dynamic pointcuts, Spring still performs a static check using matches(Method, Class)
the first time amethod is invoked to determine the overall applicability of a method. However, in
addition to this and provided that the static check returned true, Spring performs a further check
for each invocation of a method using the matches(Method, Class, Object[]) method. In this way,
a dynamic MethodMatcher can determine whether a pointcut should apply based on a particular
invocation of a method, not just on the method itself.
Clearly, static pointcuts—that is, pointcuts whose MethodMatcher is static—perform much
better than dynamic pointcuts, because they avoid the need for an additional check per invocation.
That said, dynamic pointcuts provide a greater level of flexibility for deciding whether to apply advice.
In general, we recommend that you use static pointcuts wherever you can. However, in cases where
your advice adds substantial overhead, it may be wise to avoid any unnecessary invocations of your
advice by using a dynamic pointcut.
In general, you rarely create your own Pointcut implementations from scratch, because Spring
provides abstract base classes for both static and dynamic pointcuts. We look at these base classes,
along with other Pointcut implementations, over the next few sections.

 

这段 我觉得 几乎是翻译 然后口水话一哈!

 

 

 

 简直就是 pro spring的加强翻译版!

 

 不知道如果在大学教授 这个算不算学术造假!

 

 关键这个 揭秘名字有点假

 

 

 建议 买此书前看看pro spring【也有中文版,翻译怎么样不知道,我看的的free版本的英文版】在决定买不买【价格差不多】

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值