<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    kukooBlog

    look to the master, follow the master, walk with the master, see through the master, become the master.

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      213 隨筆 :: 0 文章 :: 285 評論 :: 0 Trackbacks
    我在5月25號的的blog: 如何思考Design Pattern?中,轉載了Eric Gamma對于Design Pattern 的論述(這是Artima Developer的總編 Bill Venners對Erich Gamma的采訪中的第一部分)。而第二部分中,Bill 和 Eric 則討論了重用性的重要性 (importance of reusability)。

          重用的最高境界是什么?我們創建一個非常高層的,面向具體應用的框架,然后只要做簡單的客戶化,并且重用這個框架中現有的設計。(“We thought the way to create software was to build high-level, domain-specific frameworks, and then you just customize them and reuse all the design that is codified into them. That was the reuse nirvana.”)但是,連Eric都意識到,這太理想化了,因為 “ I have learned that it's hard to create highly reusable frameworks.”

          在談到可重用的framework的時候,Eric提到了Eclipse:

        “A good example of how I like to see reuse at work is Eclipse. It's built of components we call plug-ins. A plug-in bundles your code and there is a separate manifest where you define which other plug-ins you extend and which points of extension your plug-in offers. Plug-ins provide reusable code following explicit conventions to separate API from internal code. The Eclipse component model is simple and consistent too. It has this kernel characteristic. Eclipse has a small kernel, and everything is done the same way via extension points. The combination of a component model and the focus on APIs is one of the key ingredients of Eclipse. Controlled extensibility is another important one. (Eclipse是構構建在我們稱之為plug-in的組件上面的。一個plug-in含有你的代碼,而且詳細定義了你從哪些其他的plug-in擴展而來,以及你的plug-in提供了哪些擴展點給別人使用。Plug-in提供了可重用的代碼,而且遵循將API和內部的代碼分離開。同時,Eclipse的組件模式簡單而且一致。Eclipse只有一個很小的核心,所有其他的都市通過擴展點這種同樣的方式來做的。Eclipse中的一個重要組成部分就是組件模型和面向API的方式的結合。另一個重要點則是受到控制的擴展性。)”


          那么,什么又是Controlled extensibility呢?為什么要對擴展性進行控制呢?

        “You can go and expose everything, and people can change anything. The original Smalltalks had some of this flavor. The problems start when the next version comes along. If you have exposed everything, you cannot change anything or you break all your clients. … Also when you study the Eclipse API you will find that we go further than just specifying which classes are published API. The Eclipse API also specifies whether a class is intended to be subclassed. (你可以把一切都公布出來,SmallTalk就是這樣做的。但是,當下一個版本出來的時候,可能就會碰到問題。如果你公布了一切,那么你就不能做改動了,活著你可能會破壞你的客戶端使用的東西….在Eclipse里面,我們不僅僅定義了哪些類是公開的API,我們處理得更深層次,我們甚至定義了哪些API是可以被擴展的,哪些不可以。” 


          Eric對于重用,定義了三個級別:最低一級,重用類(classes);最高一級,框架(framework);而中間一級,就是設計模式(Design Pattern)(“This is where I see patterns. Design patterns are both smaller and more abstract than frameworks. They're really a description about how a couple of classes can relate to each other and interact with each other. The level of reuse increases when you move from classes to patterns and finally frameworks. ”

          Eric提到了一個有趣的現象。通常,我們拿到一個需求,會先做設計,做設計的時候,我們會使用設計模式(Design Pattern)。但是,使用XP (eXtreme Programming)方式的人不這樣做,他們先寫測試(“They write a test”)

          那么,設計一個framework的時候,要注意什么呢?要避免frameworkitis. (“ Frameworks abstract and provide higher level default functionality. To do so the framework needs to be in control. This loss of control can lead to what is sometimes called frameworkitis. ”)

         Frameworkitis就是說,一個framework想要做的東西太多,或者它并不是按照你設想的做的而你又不能去改動它。(“Frameworkitis is the disease that a framework wants to do too much for you or it does it in a way that you don't want but you can't change it.”)

          而且,一個framework要做的比較小,因為,如果framework太大了,那么它可能就會做太多(可能會frameworkitis),而且,不容易學習,學習曲線太長,也不容易維護。

          Eria的論述真是非常精彩,而且也解釋了Eclipse的一些內部設計。一定要閱讀全文


    [Update] 感謝lxwde的中文翻譯。我的中文翻譯可能不完全準確。中文翻譯,請參考Related Links中給出的lxwde的中文翻譯鏈接。




    Artima developer
    訪談的第一部分
    如何思考Design Pattern?
    CSDN上的中文翻譯

    Email this store to a friend (send a short email with a subject to this story)
    Subscribe to kukooBlog (subscribe kukooBlog's RSS feed)
    Send me feedback on this story

    Yourit ,, Technorati cosmos
    Mycat Programming, Eclipse

    posted on 2005-05-31 14:20 kukooBlog 閱讀(1305) 評論(1)  編輯  收藏 所屬分類: Eclipse 、Programming

    評論

    # re: 靈活性和可重用 [Eric Gamma] 2005-06-01 10:58 大胃
    前不久剛看完Part I,還沒來得及看這個Part II。等中午讀一讀。  回復  更多評論
      

    主站蜘蛛池模板: 国产精品亚洲片在线观看不卡| 久久精品国产亚洲AV无码麻豆| 亚洲一区在线免费观看| 亚洲jjzzjjzz在线观看| 99视频有精品视频免费观看| 国产一区二区三区无码免费| 亚洲精品无码久久一线| baoyu116.永久免费视频| 亚洲精品中文字幕乱码三区| 国产在线国偷精品免费看| 亚洲三级高清免费| 亚洲人成网77777亚洲色| 国内精品免费在线观看| 久久久久久a亚洲欧洲AV| 在线观看免费中文视频| 亚洲一区二区三区不卡在线播放| 日韩视频在线精品视频免费观看 | 可以免费观看的毛片| 亚洲免费视频网站| 人妻仑乱A级毛片免费看| 亚洲午夜福利717| 久久久久成人精品免费播放动漫| 亚洲精品成人区在线观看| 中国国语毛片免费观看视频| 亚洲日本在线观看| 性xxxx视频播放免费| 久久国产精品免费一区| 亚洲&#228;v永久无码精品天堂久久| 亚洲精品在线视频观看| 欧美三级在线电影免费| 午夜视频免费在线观看| 免费看www视频| 久久精品国产亚洲| 亚洲人成欧美中文字幕| 亚洲乱人伦精品图片| 日韩人妻无码精品久久免费一 | 久久久久亚洲爆乳少妇无| 日韩精品成人亚洲专区| 羞羞视频免费网站日本| 亚洲av日韩av天堂影片精品| 久久午夜免费视频|