摘要: 最近覺得一個網站架構師,應該把高性能問題搞得很好。大致整理一下。今后會在幾個方面繼續深入。
本文的圖形,沒有上來。需要看完整的,請下載 :西津渡如何設計軟件
高性能是其中的部分內容。目前還不夠深思熟慮,請有經驗者指正。多謝。
閱讀全文
修訂了一版圖解軟件項目管理。
圖解軟件項目管理加強的部分:
軟件項目的商業背景, 項目的平衡術, 關鍵路徑的管理。
這個模式一直沒有好好的理解。最近作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;
}
}
摘要: 原則: "更多的考慮用對象組合機制,而不是用對象繼承機制". 更多的重用。
幾種模式的區別:
adapter 意圖是把已經有的部件,adapt 過來,到一個需要不同接口的部件。
bridge 的意圖是讓 abstract. 以及 implementor 可以用在更多的地方。 (費這么大勁,目的就是重用)
proxy 的意圖是在proxy 中搞點什么。
下面是在junit 中run 一段別人的代碼,演示bridge 模式。
閱讀全文
根據我以前的經驗,以及最近的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
摘要:
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
閱讀全文
我答scjp 比較差,所以感覺自己還不夠professional 。做了不少應用,不過作為一個職業人士,基礎的東西也應該很好。這兩天惡補一下。
swing 也要學習。
1. java performance tuning
2. java5 's new feature ok
3. jdbc performance
最近一直用已有的知識,再規劃一下,最近的學習重點
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