2009年8月18日

          英文里動詞是一個句子中不可缺少的部分。
          1.完全及物動詞
          動詞加了賓語后意思很完全。
          形態:
          主語+完全及物動語+賓語
          I love her.
          Don't hit me.
          主語+be動詞+現在分語+賓語
          I am pulishing him.
          主語+be動語+過去分語
          He was hit.
          2.完全不及物動詞
          形態:
          主語+完全不及物動詞
          He ran.
          主動+be動詞+現在分詞
          He was running.
          3.不完全不及物動詞 例如:be動語
          主語+不完全不及物動語+補語
          He becomes handsome.
          He got mad/angry/hungry
          He got hurted/killed.
          He face turned pale.
          The leaves are turning yellow.
          4.不完全及物動詞
          I make him wash the car. make/have sb do sth(動詞原型)
          get sb to do sth
          let sb do sth
          I let him sing a song.
          let up雨停了
          I have a house to let.我有房子要出租

          I will force him to do it.
          That story cause me to cry.

          5.受予動詞
          I gave him a car.
          give后跟的是雙賓語,第一個間接賓語(通常是人或對象),第二個直接賓語(通常是事或物)
          tell,lend
          I gave a book to him.
          I teach english to him.
          I bought a book for him.
          I made a chair fom him.

          posted @ 2009-08-30 21:35 在從未放棄的路上 閱讀(188) | 評論 (0)編輯 收藏

          在英文里,動語不能直接做主語,要變為動名詞或者不定式短語。
          例如:
          Working with him is interesting.
          To learn engish with peter is fan.
          動名詞用于做有經驗的事情。
          不定式用于沒有實現的事情,例如計劃,設想等。

          如果不定式短語做為主語過長,可以虛的主語,it來代替,不定式短語放在句尾。
          例如:
          It it my plan to study aboard with very good friend of mine whose call jone.

          中文里可以用句子做主語,而英文里不可以,要將句子變為名詞從句。
          句子前面加一個連詞that,構成名詞從句。
          例如:
          That she loves me is ture.
          That he doesn't agree with me makes me angry.
          It makes me angry that he doesn't agree with me.

          posted @ 2009-08-29 20:37 在從未放棄的路上 閱讀(2884) | 評論 (0)編輯 收藏

          1.Self Encapsulate Field

          為這個field建立getting/setting method,并且只通過這些函數來訪問field.
          例:
          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
          將一個數據項變成一個對象。
          3.Change Value to Reference
          將這個實值對象變成一個引用對象。
          4.Change Reference to Value
          將一個引用對象變成實值對象。
          例:
          Class Currency{
          private String code;
          public String getCode()}
              return code;
          }
          private Currency(String code){
              this.code=code;
          }
          }
          5.Replace Array with Object
          以對象替換數組,對于數組中的每個元素,以一個值域表示之。
          例:
          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

          posted @ 2009-08-18 21:02 在從未放棄的路上 閱讀(232) | 評論 (0)編輯 收藏

          Abstract Factory
          通過工廠類創建某一對象,而不是直接使用new關鍵字。
          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();

          posted @ 2009-08-18 21:01 在從未放棄的路上 閱讀(183) | 評論 (0)編輯 收藏


          posts - 9, comments - 0, trackbacks - 0, articles - 3

          Copyright © 在從未放棄的路上

          主站蜘蛛池模板: 长沙市| 亚东县| 阿坝县| 娱乐| 大足县| 华亭县| 乐山市| 洱源县| 威海市| 遂川县| 玉林市| 仁寿县| 舟曲县| 交城县| 古田县| 宁阳县| 新民市| 沛县| 务川| 巧家县| 金山区| 广河县| 成都市| 扎鲁特旗| 鸡泽县| 体育| 子长县| 泗洪县| 洛南县| 明溪县| 拉萨市| 团风县| 城固县| 河西区| 汕尾市| 黄龙县| 玛曲县| 城步| 页游| 葵青区| 东港市|