Daniel-Journey Weekly Dose-2009/11/29
Java
Spring 的优秀工具类盘点,第 1 部分: 文件资源操作和 Web 相关工具类
Spring 的优秀工具类盘点,第 2 部分: 特殊字符转义和方法入参检测工具类
Thoughts on Java logging and SLF4J
Getting Started with Terracotta
Terrocotta – 基于JVM的Java应用集群解决方案
面向对象设计
Applying Strategy Pattern Instead of Using Switch Statements
What we gain by using Strategy Pattern?
- The code is easier to read. I don’t need to go and read (or
search) an “endless” switch statement to understand each
aspect of the code.- The code is more maintainable. I only need to go to the
relevant class that implement the algorithm in order to change it
or refactor it when needed.- It is easier to add more algorithms. I only need to add more classes
to the pile of algorithms and that is it. Doing so helps us to imply
the Open / Closed Principle because in switch statement we are going
to have to change our code (add another case statement) in opposed
to Strategy which we add another algorithm class.- Strategy Pattern is more testable.
数据库
其他
Transfer Obejcts vs Business Objects – Which Approach Works Best
