frank oo java

我爱oo,我爱java。http://oofrank.blogchina.com

My Links

Blog统计

公告

欢迎到 oofrank@blogchina 来 QQ:421057986 email:oofrank@163.com
www.flickr.com
oofrank@flickr with my S9500

Free Download Manager
Free Download Manager

文章

收藏

相册

IT

other

存档


正在读取评论……

1

Duplicated Code

重复的代码

Extract Method

2

Long Method

过长的函数

Extract Method, Replace Temp with Query

3

Large Class

过大类,可能违反SRP,DIP,ISP

Extract Class,Extract Interface

4

Long Parameter List

过长的参数列表

Introduce Parameter Object,Preserve Whole Object

5

Divergent Change

发散式变化,多种变化影响一个类,违反SRP

Extract Class,Extract Interface

6

Shotgun Surgery

霰弹式修改,一个变化影响多个类,可能类之间不够高内聚

Move Method,Move Field

7

Feature Envy

依恋情结,两个类之间互相作用过多,类之间不够低耦合,类由数据和处理这些数据的方法组成

Move Method,Extract Method

8

Data Clumps

数据泥团,一组数据在不同的地方多次重复出现

Extract Class,Introduce Parameter Object,Preserve Whole Object

9

Primitive Obsession

基本型偏执,对本该是类的值用基本类型

Replace Data Value with Object,Replace Type Code with State/Strategy,Extract Class

10

Switch Statements

switch惊现身,出现多处类似的switch

Replace Conditional with Polymorphism,Replace Parameter with Explicit Methods,Introduce Null Object

11

Parallel Inheritance Hierarchies

平行继承体系,当增加一个新类时总是要增加另一个类

 

12

Lazy Class

冗赘类

Inline Class

13

Speculative Generality

夸夸其谈未来性,在没有任何暗示的情况下考虑扩展

Rename Method

14

Temporary Field

令人迷惑的暂时值域, 使用临时变量太多并且作用域不当

Introduce Null Object,Extract Class[to method object]

15

Message Chains

过度耦合的消息链,太长的委托关系链

Hide Delegate

16

Middle Man

中间转手人,一个类多数方法委托给另一个类〔类与类的关系*Wrapper(反例)〕

Remove Middle Man,Inline Method.    

17

Inappropriate Intimacy

狎昵关系,两个类过于相互依赖private内容

,类之间不够低耦合

Extract Class,Hide Delegate

18

Alternative Classes with Different Interfaces

异曲同功的类

Rename Method,Move Method,Extract Superclass

19

Incomplete Library Class

不完美的程序库类,没有代码的需要扩展的类库

Introduce Foreign Method,Introduce Local Extension

20

Data Class

纯稚的数据类,只有数据的类

[Feature Envy]

21

Refused Bequest

被拒绝的遗赠,继承了一个类,但不愿继承所有接口,即有多个接口不被自己的潜在客户使用

Replace Inheritance with Delegation

22

Comments

过多的注释

我们之所以要在这里提到Comments,因为人们常把它当作除臭剂来使用。

 



Trackback: http://tb.donews.net/TrackBack.aspx?PostId=357484


[点击此处收藏本文]  发表于2005年04月30日 8:50 AM




正在读取评论……
大名
网址
验证码
评论