Xiaobo Sun

          Eclipse-Unix http://umlfact.berlios.de/~s_xsun/

          Composition & Aggregation

          Composition: b's lifetime is up to its context (object of A).
          ==C++==
          class A{
              B b;
          }
          ==java==
          class A{
              B b;
              public A(){
                 b = new B();
              }
          }

          Aggregation: b can live without its context (object of A).
          ============================================
          ==C++==
          class B{
              B* b;
          }
          ==java==
          class B{
              B b;
              public A(B b){
                 this.b = b;
              }
          }

          posted on 2007-07-12 16:39 Xiaobo Sun 閱讀(289) 評論(0)  編輯  收藏 所屬分類: UML


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2007年7月>
          24252627282930
          1234567
          891011121314
          15161718192021
          22232425262728
          2930311234

          導航

          統計

          常用鏈接

          留言簿(3)

          隨筆分類

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 阿坝| 五台县| 筠连县| 社会| 高阳县| 湾仔区| 蛟河市| 临武县| 南通市| 平潭县| 会宁县| 邛崃市| 台中县| 阜阳市| 松溪县| 即墨市| 利津县| 光山县| 洪雅县| 富蕴县| 宣武区| 肃南| 洛川县| 蓬溪县| 辽阳市| 屏山县| 崇明县| 美姑县| 民县| 江阴市| 乃东县| 海林市| 甘泉县| 右玉县| 衡东县| 弥渡县| 固原市| 盱眙县| 如皋市| 三门县| 天台县|