- 博客(1)
- 资源 (27)
- 收藏
- 关注
转载 【IT微笑话】
一女遇抢劫,颤抖曰:“大哥,我是搞java的,两个月没发工资了,还刚被裁员,真的没有钱…”劫匪听后竟痛哭,“妹子,同行,俺原来是做C++的,金融危机闹得做劫匪也不踏实,你拿好工牌,后面那帮抢劫是做.NET的,你放心,我们绝不抢自己人。对了,边上那条路不要走,那边是搞PHP的
2011-09-02 09:12:13 374
重构-改善既有代码的设计+中文版
Chapter 1:Refactoring,a First Example 重构,第一个例子
The Starting Point 起点
The First Step in Refactoring 重构第一步
Decomposing and Redistributing the Statement Method 分解并重组slalemenl方法
Replacing the Conditional Logic on Price Code with Polymorphism 用多态代替价格条件逻辑代码
Final Thoughts 结语
Chapter 2:Principles in Refactoring 重构原则
Defining Refactoring 何谓重构
Why Should You Refactor? 为何重构
When Should You Refactor? 何时重构
What Do I Tell My Manager? 怎样说服经理
Problems with Refactoring 重构的问题
Refactoring and Design 重构与设计
Refactoring and Performance 重构与性能
Where Did Refactoring Come From? 重构的起源
Chapter 3:Bad Smells in Code(by Kent Beck and Martin Fowler) 代码坏昧
Duplicated Code 重复代码
Long Method 过长方法
Large Class 过长类
Long Parameter List 过长参数列表
Divergent Change 发散式变化
Shotgun Surgery 霰弹式修改
Feature Envy 特性依恋
Data Clumps 数据泥团
Primitive Obsession 基本类型偏执
Switch Statements switch语句
Parallel Inheritance Hierarchies 平行继承体系
Lazy Class 冗余类
Speculative Generality 理论上的一般性
Temporary Field 临时字段
Message Chains 消息链
Middle Man 中间人
Inappropriate Intimacy 过度亲密
Alternative Classes with Different Interfaces 接口不同的等效类
Incomplete Library Class 不完整的库类
Data Class 数据类
Refused Bequest 拒绝继承
Comments 注释过多
Chapter 4:Building Tests 构建测试
The Value of Self-testing Code 自测试代码的重要性
The JUnit Testing Framework Junit测试框架
Adding More Tests 添加更多测试
Chapter 5:Toward a Catalog of Refactorings 重构目录
Format of the Refactorings 重构描述的格式
Finding References 寻找引用
How Mature Are These Refactorings? 这些重构的成熟度如何
Chapter 6:Composing Methods 组合方法
Extract Method 提取方法
Inline Method 内联方法
Inline Temp 内联临时变量
*Replace Temp with Query 用查询方法代替临时变量
Introduce Explaining Variable 引入解释性变量
Split Temporary Variable 分离临时变量
*Remove Assignments to Parameters 去除参数赋值
Replace Method with Method Object 用方法对象代替方法
Substitute Algorithm 替换算法
Chapter 7:Moving Features Between Objects 在对象之间移动特性
*Move Method 移动方法
Move Field 移动字段
Extract Class 提取类
Inline Class 内联类
Hide Delegate 隐藏委托类
Remove Middle Man 去除中间人
Introduce Foreign Method 引入外加方法
*Introduce Local Extension 引入本地扩展类
Chapter 8:Organizing Data 组织数据
Self Encapsulate Field 自封装字段
Replace Data Value with Object 用对象代替数据值
Change Value to Reference 将值对象改为引用对象
Change Reference to Value 将引用对象改为值对象
Replace Array with Object 用对象代替数组
Duplicate Observed Data 重复被观察数据
*Change Unidirectional Associationto Bidirectional 将单向关联改为双向
Change Bidirectional Association to Unidirectional 将双向关联改为单向
*Replace Magic Number with Symbolic Constant 用字面常量代替魔数
Encapsulate Field 封装字段
Encapsulate Collection 封装集合
Replace Record with Data Class 用数据类代替记录
*ReplaceType Code with Class 用类代替类型码
Replace Type Code with Subclasses 用子类代替类型码
Replace Type Code with State/Strategy用State/Strategy 代替类型码
Replace Subclass with Fields 用字段代替子类
Chapter 9:Simplifying Conditional Expressions 简化条件语句
Decompose Conditional 分解条件语句
Consolidate Conditional Expression 合并条件语句
Consolidate Duplicate Conditional Fragments 合并重复的条件片段
Remove Control Flag 去除控制标志
Replace Nested Conditional with Guard Clauses 用守卫语句代替嵌套条件语句
Replace Conditional with Polymorphism 用多态代替条件语句
Introduce Null Object 引入Null对象
Introduce Assertion 引入断言
Chapter 10:Making Method Calls Simpler 简化方法调用
Rename Method 重命名方法
Add Parameter 添加参数
Remove Parameter 去除参数
Separate query from Modifier 将查询方法与修改方法分离
Parameterize Method 参数化方法
Replace Parameter with Explicit Methods 用显式方法代替参数
Preserve Whole Object 保持对象完整
Replace Parameter with Method 用方法代替参数
Introduce Parameter Object 引入参数对象
Remove Setting Method 去除设置方法
Hide Method 隐藏方法
Replace Constructor with Factory Method 用工厂方法代替构造器
Encapsulate Downcast 封装向下转型
Replace Error Code with Exception 用异常代替错误码
Replace Exception with Test 用测试代替异常
Chapter 11:Dealing with Generalization 处理泛化关系
Pull Up Field 上移字段
Pull UP Method 上移方法
Pull Up Constructor Body 上移构造器主体
Push Down Method 下移方法
Push Down Field 下移字段
Extract Subclass 提取子类
Extract Superclass 提取超类
Extract Interface 提取接口
Collapse Hierarchy 合并继承层次
Form Template Method 形成Template Method
Replace Inheritance with Delegation 用委托代替继承
Replace Delegation with Inheritance 用继承代替委托
Chapter 12:Big Refactorings(by Kent Beck and Martin Fowler) 大型重构
Tease Apart Inheritance 分解继承层次
Convert Procedural Design to Objects 将过程式设计转换为面向对象
Separate Domain from Presentation 将领域逻辑与表现分离
Extract Hierarchy 提取继承层次
Chapter 13:Refactoring,Reuse,and Reality(by William Opdyke) 重构,复用与现实
A Reality Check 现实的检验
Whv Are Developers Reluctant to Refactor Their Programs? 开发人员为何不愿重构程序
A Reality Check(Revisited) 再谈现实的检验
Resources and References for Refactoring 重构的资源和参考文献
Implications Regarding Software Reuse and Technology Transfer 对软件复用与技术传播的意义
A Final Note 结语
References 参考文献
Chapter 14:Refactoring Tools(by Don Roberts and John Brant) 重构工具
Refactoring with a Tool 使用工具重构
Technical Criteria for a Refactoring Tool 重构工具的技术标准
Practical Criteria for a Refactoring Tool 重构工具的实用标准
Wrap Up 结语
Chapter 15:Putting It All Together(by Kent Beck) 集大成
References参考文献
List of Soundbites 要点列表
Updates 更新内容
Index 索引
2011-12-06
大象--Thinking in UML
大象希形
写给读者的话
关于本书
如何阅读本书
光盘使用说明
第一部分 准备篇——需要了解
第1章 为什么需要UML
第2章 建模基础
第二部分 基础篇——在学习中思考
第3章 UML核心元素
第4章 UML核心视图
第5章 UML核心模型
第6章 统一过程核心工作流简介
第三部分 进阶篇——在实践中思考
第8章 准备工作
第9章 获取需求
第10章 需求分析
第11章 系统分析
第12章 系统设计
第13章 开发
第14章 测试
第四部分 高级篇——在提炼中思考
第15章 理解用例的本质
第17章 理解建模的抽象层次
第18章 划分子系统的问题
第19章 学会使用系统边界
第20章 学会从接口认知事物
第21章 学会正确选择
第22章 学会使用设计模式
附录 UML视图常用元素参考
图目录
表目录
后记
2011-12-06
Hibernate中文详细学习文档
符合Java习惯的关系数据库持久化
前言
1. 翻译说明
2. 版权声明
1. Hibernate入门
1.1. 前言
1.2. 第一部分 - 第一个Hibernate应用程序
1.2.1. 第一个class
1.2.2. 映射文件
1.2.3. Hibernate配置
1.2.4. 用Ant构建
1.2.5. 启动和辅助类
1.2.6. 加载并存储对象
1.3. 第二部分 - 关联映射
1.3.1. 映射Person类
1.3.2. 单向Set-based的关联
1.3.3. 使关联工作
1.3.4. 值类型的集合
1.3.5. 双向关联
1.3.6. 使双向连起来
1.4. 第三部分 - EventManager web应用程序
1.4.1. 编写基本的servlet
1.4.2. 处理与渲染
1.4.3. 部署与测试
1.5. 总结
2. 体系结构(Architecture)
2.1. 概况(Overview)
2.2. 实例状态
2.3. JMX整合
2.4. 对JCA的支持
2.5. 上下文相关的(Contextual)Session
3. 配置
3.1. 可编程的配置方式
3.2. 获得SessionFactory
3.3. JDBC连接
3.4. 可选的配置属性
3.4.1. SQL方言
3.4.2. 外连接抓取(Outer Join Fetching)
3.4.3. 二进制流 (Binary Streams)
3.4.4. 二级缓存与查询缓存
3.4.5. 查询语言中的替换
3.4.6. Hibernate的统计(statistics)机制
3.5. 日志
3.6. 实现NamingStrategy
3.7. XML配置文件
3.8. J2EE应用程序服务器的集成
3.8.1. 事务策略配置
3.8.2. JNDI绑定的SessionFactory
3.8.3. 在JTA环境下使用Current Session context (当前session上下文)管理
3.8.4. JMX部署
4. 持久化类(Persistent Classes)
4.1. 一个简单的POJO例子
4.1.1. 实现一个默认的(即无参数的)构造方法(constructor)
4.1.2. 提供一个标识属性(identifier property)(可选)
4.1.3. 使用非final的类 (可选)
4.1.4. 为持久化字段声明访问器(accessors)和是否可变的标志(mutators)(可选)
4.2. 实现继承(Inheritance)
4.3. 实现equals()和hashCode()
4.4. 动态模型(Dynamic models)
4.5. 元组片断映射(Tuplizers)
5. 对象/关系数据库映射基础(Basic O/R Mapping)
5.1. 映射定义(Mapping declaration)
5.1.1. Doctype
5.1.2. hibernate-mapping
5.1.3. class
5.1.4. id
5.1.5. composite-id
5.1.6. 鉴别器(discriminator)
5.1.7. 版本(version)(可选)
5.1.8. timestamp (可选)
5.1.9. property
5.1.10. 多对一(many-to-one)
5.1.11. 一对一
5.1.12. 自然ID(natural-id)
5.1.13. 组件(component), 动态组件(dynamic-component)
5.1.14. properties
5.1.15. 子类(subclass)
5.1.16. 连接的子类(joined-subclass)
5.1.17. 联合子类(union-subclass)
5.1.18. 连接(join)
5.1.19. 键(key)
5.1.20. 字段和规则元素(column and formula elements)
5.1.21. 引用(import)
5.1.22. any
5.2. Hibernate 的类型
5.2.1. 实体(Entities)和值(values)
5.2.2. 基本值类型
5.2.3. 自定义值类型
5.3. 多次映射同一个类
5.4. SQL中引号包围的标识符
5.5. 其他元数据(Metadata)
5.5.1. 使用 XDoclet 标记
5.5.2. 使用 JDK 5.0 的注解(Annotation)
5.6. 数据库生成属性(Generated Properties)
5.7. 辅助数据库对象(Auxiliary Database Objects)
6. 集合类(Collections)映射
6.1. 持久化集合类(Persistent collections)
6.2. 集合映射( Collection mappings )
6.2.1. 集合外键(Collection foreign keys)
6.2.2. 集合元素(Collection elements)
6.2.3. 索引集合类(Indexed collections)
6.2.4. 值集合于多对多关联(Collections of values and many-to-many associations)
6.2.5. 一对多关联(One-to-many Associations)
6.3. 高级集合映射(Advanced collection mappings)
6.3.1. 有序集合(Sorted collections)
6.3.2. 双向关联(Bidirectional associations)
6.3.3. 双向关联,涉及有序集合类
6.3.4. 三重关联(Ternary associations)
6.3.5. 使用<idbag>
6.4. 集合例子(Collection example)
7. 关联关系映射
7.1. 介绍
7.2. 单向关联(Unidirectional associations)
7.2.1. 多对一(many to one)
7.2.2. 一对一(one to one)
7.2.3. 一对多(one to many)
7.3. 使用连接表的单向关联(Unidirectional associations with join tables)
7.3.1. 一对多(one to many)
7.3.2. 多对一(many to one)
7.3.3. 一对一(one to one)
7.3.4. 多对多(many to many)
7.4. 双向关联(Bidirectional associations)
7.4.1. 一对多(one to many) / 多对一(many to one)
7.4.2. 一对一(one to one)
7.5. 使用连接表的双向关联(Bidirectional associations with join tables)
7.5.1. 一对多(one to many) /多对一( many to one)
7.5.2. 一对一(one to one)
7.5.3. 多对多(many to many)
7.6. 更复杂的关联映射
8. 组件(Component)映射
8.1. 依赖对象(Dependent objects)
8.2. 在集合中出现的依赖对象 (Collections of dependent objects)
8.3. 组件作为Map的索引(Components as Map indices )
8.4. 组件作为联合标识符(Components as composite identifiers)
8.5. 动态组件 (Dynamic components)
9. 继承映射(Inheritance Mappings)
9.1. 三种策略
9.1.1. 每个类分层结构一张表(Table per class hierarchy)
9.1.2. 每个子类一张表(Table per subclass)
9.1.3. 每个子类一张表(Table per subclass),使用辨别标志(Discriminator)
9.1.4. 混合使用“每个类分层结构一张表”和“每个子类一张表”
9.1.5. 每个具体类一张表(Table per concrete class)
9.1.6. Table per concrete class, using implicit polymorphism
9.1.7. 隐式多态和其他继承映射混合使用
9.2. 限制
10. 与对象共事
10.1. Hibernate对象状态(object states)
10.2. 使对象持久化
10.3. 装载对象
10.4. 查询
10.4.1. 执行查询
10.4.2. 过滤集合
10.4.3. 条件查询(Criteria queries)
10.4.4. 使用原生SQL的查询
10.5. 修改持久对象
10.6. 修改脱管(Detached)对象
10.7. 自动状态检测
10.8. 删除持久对象
10.9. 在两个不同数据库间复制对象
10.10. Session刷出(flush)
10.11. 传播性持久化(transitive persistence)
10.12. 使用元数据
11. 事务和并发
11.1. Session和事务范围(transaction scope)
11.1.1. 操作单元(Unit of work)
11.1.2. 长对话
11.1.3. 关注对象标识(Considering object identity)
11.1.4. 常见问题
11.2. 数据库事务声明
11.2.1. 非托管环境
11.2.2. 使用JTA
11.2.3. 异常处理
11.2.4. 事务超时
11.3. 乐观并发控制(Optimistic concurrency control)
11.3.1. 应用程序级别的版本检查(Application version checking)
11.3.2. 扩展周期的session和自动版本化
11.3.3. 脱管对象(deatched object)和自动版本化
11.3.4. 定制自动版本化行为
11.4. 悲观锁定(Pessimistic Locking)
11.5. 连接释放模式(Connection Release Modes)
12. 拦截器与事件(Interceptors and events)
12.1. 拦截器(Interceptors)
12.2. 事件系统(Event system)
12.3. Hibernate的声明式安全机制
13. 批量处理(Batch processing)
13.1. 批量插入(Batch inserts)
13.2. 批量更新(Batch updates)
13.3. StatelessSession (无状态session)接口
13.4. DML(数据操作语言)风格的操作(DML-style operations)
14. HQL: Hibernate查询语言
14.1. 大小写敏感性问题
14.2. from子句
14.3. 关联(Association)与连接(Join)
14.4. join 语法的形式
14.5. select子句
14.6. 聚集函数
14.7. 多态查询
14.8. where子句
14.9. 表达式
14.10. order by子句
14.11. group by子句
14.12. 子查询
14.13. HQL示例
14.14. 批量的UPDATE和DELETE
14.15. 小技巧 & 小窍门
15. 条件查询(Criteria Queries)
15.1. 创建一个Criteria 实例
15.2. 限制结果集内容
15.3. 结果集排序
15.4. 关联
15.5. 动态关联抓取
15.6. 查询示例
15.7. 投影(Projections)、聚合(aggregation)和分组(grouping)
15.8. 离线(detached)查询和子查询
15.9. 根据自然标识查询(Queries by natural identifier)
16. Native SQL查询
16.1. 使用SQLQuery
16.1.1. 标量查询(Scalar queries)
16.1.2. 实体查询(Entity queries)
16.1.3. 处理关联和集合类(Handling associations and collections)
16.1.4. 返回多个实体(Returning multiple entities)
16.1.5. 返回非受管实体(Returning non-managed entities)
16.1.6. 处理继承(Handling inheritance)
16.1.7. 参数(Parameters)
16.2. 命名SQL查询
16.2.1. 使用return-property来明确地指定字段/别名
16.2.2. 使用存储过程来查询
16.3. 定制SQL用来create,update和delete
16.4. 定制装载SQL
17. 过滤数据
17.1. Hibernate 过滤器(filters)
18. XML映射
18.1. 用XML数据进行工作
18.1.1. 指定同时映射XML和类
18.1.2. 只定义XML映射
18.2. XML映射元数据
18.3. 操作XML数据
19. 提升性能
19.1. 抓取策略(Fetching strategies)
19.1.1. 操作延迟加载的关联
19.1.2. 调整抓取策略(Tuning fetch strategies)
19.1.3. 单端关联代理(Single-ended association proxies)
19.1.4. 实例化集合和代理(Initializing collections and proxies)
19.1.5. 使用批量抓取(Using batch fetching)
19.1.6. 使用子查询抓取(Using subselect fetching)
19.1.7. 使用延迟属性抓取(Using lazy property fetching)
19.2. 二级缓存(The Second Level Cache)
19.2.1. 缓存映射(Cache mappings)
19.2.2. 策略:只读缓存(Strategy: read only)
19.2.3. 策略:读/写缓存(Strategy: read/write)
19.2.4. 策略:非严格读/写缓存(Strategy: nonstrict read/write)
19.2.5. 策略:事务缓存(transactional)
19.3. 管理缓存(Managing the caches)
19.4. 查询缓存(The Query Cache)
19.5. 理解集合性能(Understanding Collection performance)
19.5.1. 分类(Taxonomy)
19.5.2. Lists, maps 和sets用于更新效率最高
19.5.3. Bag和list是反向集合类中效率最高的
19.5.4. 一次性删除(One shot delete)
19.6. 监测性能(Monitoring performance)
19.6.1. 监测SessionFactory
19.6.2. 数据记录(Metrics)
20. 工具箱指南
20.1. Schema自动生成(Automatic schema generation)
20.1.1. 对schema定制化(Customizing the schema)
20.1.2. 运行该工具
20.1.3. 属性(Properties)
20.1.4. 使用Ant(Using Ant)
20.1.5. 对schema的增量更新(Incremental schema updates)
20.1.6. 用Ant来增量更新schema(Using Ant for incremental schema updates)
20.1.7. Schema 校验
20.1.8. 使用Ant进行schema校验
21. 示例:父子关系(Parent Child Relationships)
21.1. 关于collections需要注意的一点
21.2. 双向的一对多关系(Bidirectional one-to-many)
21.3. 级联生命周期(Cascading lifecycle)
21.4. 级联与未保存值(Cascades and unsaved-value)
21.5. 结论
22. 示例:Weblog 应用程序
22.1. 持久化类
22.2. Hibernate 映射
22.3. Hibernate 代码
23. 示例:复杂映射实例
23.1. Employer(雇主)/Employee(雇员)
23.2. Author(作家)/Work(作品)
23.3. Customer(客户)/Order(订单)/Product(产品)
23.4. 杂例
23.4.1. "Typed" one-to-one association
23.4.2. Composite key example
23.4.3. 共有组合键属性的多对多(Many-to-many with shared composite key attribute)
23.4.4. Content based discrimination
23.4.5. Associations on alternate keys
24. 最佳实践(Best Practices)
等等。。。
2011-11-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人