Spring 配置文件最佳实践1. 给配置文件加上注释1234567<beans> <description> This configuration file will have all beans which may be used for controlling transactions. </description...
Spring Core Tutorials
Spring Core Tutorials
Spring bean scopes概念examplexml:12345678<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc...
重构-改善既有代码的设计-书摘
重构-改善既有代码的设计-书摘
重构是在不改变软件可观察行为的前提下改善其内部结构。设计模式为重构行为提供了目标,模式是你希望到达的目标,重构则是到达之路。
重构,第一个案例
如果你发现自己需要为程序添加一个特性,而代码结构使你无法很方便地达成目的,那就先重构那个程序,使特性的添加比较容易进行,然后再添加特性。
重构之前,首先检查自己是否有一套可靠的测试机制。这些测试必须有自我检验能力。
重...
设计模式-单例,原型与构建器
设计模式-单例,原型与构建器创建型模式创建型模式处理对象的初始化和克服构造函数的限制。
Singleton,
Builder,
Prototype,
Abstract Factory,
Factory pattern.
其他
other type of factories (like the static one),
pool pattern,
lazy initialization...