摘要: 最近覺得一個網站架構師,應該把高性能問題搞得很好。大致整理一下。今后會在幾個方面繼續深入。

          本文的圖形,沒有上來。需要看完整的,請下載 :西津渡如何設計軟件

          高性能是其中的部分內容。目前還不夠深思熟慮,請有經驗者指正。多謝。
            閱讀全文
          posted @ 2007-08-15 18:22 西津渡 閱讀(1835) | 評論 (1)編輯 收藏
           
          修訂了一版圖解軟件項目管理。 圖解軟件項目管理
          加強的部分:
             軟件項目的商業背景, 項目的平衡術, 關鍵路徑的管理。
            


          posted @ 2007-08-10 13:16 西津渡 閱讀(938) | 評論 (3)編輯 收藏
           
          這個模式一直沒有好好的理解。最近作IM 相關的應用,才明白了。
          就是兩個人之間要溝通,不是直接,而是通過 mediator.
          也就是 ,不是
                  user1.sendMessage(user2,"some message");
                 而是
                  user1.getMediator().sendMessage("user2","some message");

           有什么好處呢:
                  職責分離:mediator 完成自己該承擔的職責。
                  mediator 也可以搞這搞那。

          插一段實際代碼:
                conn.getChatManager().createChat("thewho@stephenli",new MessageListener() {

                      public void processMessage(Chat chat, Message message) {
                         
                          if(logger.isDebugEnabled())
                          logger.debug("Received message: " + message.toXML());
                         
                      }
                  }).sendMessage("測試發送!");


          下面是junit 一段別人的代碼,可以Run:

          代碼看起來很蠢,不能說明使用mediator 的好處。不過意思就是這樣啦!(從C# 拷的)


          import junit.framework.TestCase;


          public class MediatorTest extends TestCase {
             
              public void testMediator(){
                  Mediator m = new Mediator();
                  DataProviderColleague c1 = new DataProviderColleague(m);
                  DataConsumerColleague c2 = new DataConsumerColleague();
                  m.IntroduceColleagues(c1,c2);

                  c1.ChangeData();
                 
              }
          }



              class Mediator
              {
                  private DataProviderColleague dataProvider;
                  private DataConsumerColleague dataConsumer;
                  public void IntroduceColleagues(DataProviderColleague c1, DataConsumerColleague c2)
                  {
                      dataProvider = c1;
                      dataConsumer = c2;           
                  }
                 
                  public void DataChanged()
                  {
                      int i = dataProvider.getIMyData();
                      dataConsumer.NewValue(i);
                  }
              }

              class DataConsumerColleague
              {
                  public void NewValue(int i)
                  {
                      System.out.println("New value "+ i);
                  }
              }

              class DataProviderColleague
              {
                  private Mediator mediator;
                  private int iMyData=0;
                  private int MyData ;
             
                  public DataProviderColleague(Mediator m)
                  {
                      mediator = m;
                  }

                  public void ChangeData()
                  {
                      iMyData = 403;

                      // Inform mediator that I have changed the data
                      if (mediator != null)
                          mediator.DataChanged();   
                  }

                  public int getIMyData() {
                      return iMyData;
                  }

                  public void setIMyData(int myData) {
                      iMyData = myData;
                  }       
                 
                 
                 
              }

           













          posted @ 2007-08-07 16:43 西津渡 閱讀(1011) | 評論 (0)編輯 收藏
           
               摘要: 原則: "更多的考慮用對象組合機制,而不是用對象繼承機制". 更多的重用。

          幾種模式的區別:
          adapter 意圖是把已經有的部件,adapt 過來,到一個需要不同接口的部件。
          bridge 的意圖是讓 abstract. 以及 implementor 可以用在更多的地方。 (費這么大勁,目的就是重用)
          proxy 的意圖是在proxy 中搞點什么。

          下面是在junit 中run 一段別人的代碼,演示bridge 模式。  閱讀全文
          posted @ 2007-08-07 16:04 西津渡 閱讀(744) | 評論 (0)編輯 收藏
           
          根據我以前的經驗,以及最近的struts2 的開發。我感覺的struts2 的性能問題。
          找了一篇 討論 struts2 performance 的文章:
          http://www.nabble.com/Struts-2-performance-t4053401.html

          繼續閱讀 struts2 的 performance tunning :http://struts.apache.org/2.x/docs/performance-tuning.html

          我的判斷:
           對于heavy user 的website , 不用 struts2? (直接用servlet+jsp /or ??????)
           對于few user 的 management 可以用 struts2.

          學習 stripes . stripes download 正是我想要的。
          theserverside 關于 stripes 的討論。stripes great



          posted @ 2007-07-25 11:40 西津渡 閱讀(1221) | 評論 (0)編輯 收藏
           
               摘要: StAX the odds with Woodstox


          剛讀了,感覺不錯。

          Over a decade into XML evolution, however, these parsing technologies are slowly showing their age, requiring bypasses and optimizations to overcome their well-known limitations. StAX, or Streaming API for XML, is the new-age XML parser that offers the best features of the existing models, and at the same time provides high performance and efficient access to the underlyi  閱讀全文
          posted @ 2007-07-23 10:36 西津渡| 編輯 收藏
           
          我答scjp 比較差,所以感覺自己還不夠professional 。做了不少應用,不過作為一個職業人士,基礎的東西也應該很好。這兩天惡補一下。
          swing 也要學習。
          posted @ 2007-07-20 15:48 西津渡| 編輯 收藏
           
          1. java performance tuning
          2. java5 's new feature ok
          3. jdbc performance

          posted @ 2007-07-16 14:58 西津渡 閱讀(135) | 評論 (0)編輯 收藏
           
          最近一直用已有的知識,再規劃一下,最近的學習重點
          1.rick  client 的全面掌握
            以前用dwr ,再復習一下  . ok ,prototypes . 07-08-01
          2.db procedure
            以前基本不會。
          3.ejb3
            高可靠性transaction
          4. StAX, woodstox
             學習一下新的xml 處理技術。 ok.  07-08-01
          5.REST
             新東西,很重要    .         ok. 07-08-1
          6.english




          posted @ 2007-07-13 16:25 西津渡 閱讀(188) | 評論 (0)編輯 收藏
           
          看來架構師的工作機會還是比較多。
          99 街   www.99jie.com ,是一個購物digg 網站。
          以后撿周末空余時間,逐漸把功能補全了。

          posted @ 2007-05-19 19:17 西津渡 閱讀(308) | 評論 (0)編輯 收藏
          僅列出標題
          共11頁: First 上一頁 2 3 4 5 6 7 8 9 10 下一頁 Last 
           
          主站蜘蛛池模板: 天峻县| 连州市| 攀枝花市| 瑞金市| 黄山市| 乌审旗| 日土县| 柯坪县| 无锡市| 白银市| 固安县| 咸宁市| 天门市| 兴业县| 读书| 清涧县| 工布江达县| 和林格尔县| 桐梓县| 双桥区| 如东县| 平顶山市| 腾冲县| 洛隆县| 文登市| 建湖县| 旬阳县| 郁南县| 二连浩特市| 崇礼县| 永德县| 旌德县| 合山市| 巴里| 古丈县| 伊川县| 成安县| 仙桃市| 仁怀市| 达日县| 循化|