锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品国产欧美,一二三区精品视频,一区二区三区欧美日韩http://www.aygfsteel.com/luolin/category/20858.htmlzh-cnTue, 18 Aug 2009 15:07:04 GMTTue, 18 Aug 2009 15:07:04 GMT60璇諱功絎旇錛堥噸鏋刜鏀瑰杽鏃㈡湁浠g爜璁捐_絎叓绔犻噸鏂扮粍緇囨暟鎹級http://www.aygfsteel.com/luolin/archive/2009/08/18/291213.html鍦ㄤ粠鏈斁寮冪殑璺笂鍦ㄤ粠鏈斁寮冪殑璺笂Tue, 18 Aug 2009 13:02:00 GMThttp://www.aygfsteel.com/luolin/archive/2009/08/18/291213.htmlhttp://www.aygfsteel.com/luolin/comments/291213.htmlhttp://www.aygfsteel.com/luolin/archive/2009/08/18/291213.html#Feedback0http://www.aygfsteel.com/luolin/comments/commentRss/291213.htmlhttp://www.aygfsteel.com/luolin/services/trackbacks/291213.html1.Self Encapsulate Field
涓鴻繖涓猣ield寤虹珛getting/setting method,騫朵笖鍙氳繃榪欎簺鍑芥暟鏉ヨ闂甪ield.
渚嬶細
privte int low,high;
boolean includes(int arg){
return arg>=low&&arg<=high;
}
閲嶆瀯涓猴細
private int low,high;
boolean includes(int arg){
return arg>=getLow()&&arg<=getHigh();
}
int getLow(){return low;}
int getHigh(){return high;}
2.Replace Data Value with Object
灝嗕竴涓暟鎹」鍙樻垚涓涓璞°?br />
3.Change Value to Reference
灝嗚繖涓疄鍊煎璞″彉鎴愪竴涓紩鐢ㄥ璞°?br />
4.Change Reference to Value
灝嗕竴涓紩鐢ㄥ璞″彉鎴愬疄鍊煎璞°?br />
渚嬶細
Class Currency{
private String code;
public String getCode()}
return code;
}
private Currency(String code){
this.code=code;
}
}
5.Replace Array with Object
浠ュ璞℃浛鎹㈡暟緇勶紝瀵逛簬鏁扮粍涓殑姣忎釜鍏冪礌錛屼互涓涓煎煙琛ㄧず涔嬨?br />
渚嬶細
String[] row=new String[3];
row[0]="Liverpool";
row[1]="15";
閲嶆瀯涓猴細
Performance row=new Performance();
row.setName("Liverpool");
row.setWins("15");
6.Duplicate Observed Data
7.Change Unidirectional Association to Bidirectional
8.Change Bidirectional Association to Unidirectional
]]>璁捐妯″紡錛堟娊璞″伐鍘傦級http://www.aygfsteel.com/luolin/archive/2009/08/18/291573.html鍦ㄤ粠鏈斁寮冪殑璺笂鍦ㄤ粠鏈斁寮冪殑璺笂Tue, 18 Aug 2009 13:01:00 GMThttp://www.aygfsteel.com/luolin/archive/2009/08/18/291573.htmlhttp://www.aygfsteel.com/luolin/comments/291573.htmlhttp://www.aygfsteel.com/luolin/archive/2009/08/18/291573.html#Feedback0http://www.aygfsteel.com/luolin/comments/commentRss/291573.htmlhttp://www.aygfsteel.com/luolin/services/trackbacks/291573.html
閫氳繃宸ュ巶綾誨垱寤烘煇涓瀵硅薄錛岃屼笉鏄洿鎺ヤ嬌鐢╪ew鍏抽敭瀛椼?br />
public class Computer(){
}
public class NoteBookComputer extends Computer(){
}
public abstract class ComputerFactory(){
public abstract Computer createComputer();
}
public class NoteBookComputerFactory extends ComputerFactory{
public Computer createComputer() {
return new NoteBookComputer();
}
}
client code:
ComputerFactory factory=new NoteBookComputerFactory();
Computer noteBook=factory.createComputer();