摘要: 最近觉得一个网站架构师,应该把高性能问题搞得很好。大致整理一下。今后会在几个方面继续深入。
本文的图形,没有上来。需要看完整的,请下载 :西津渡如何设计软件
高性能是其中的部分内容。目前还不够深思熟虑,请有经验者指正。多谢。
阅读全文
修订了一版图解软件项目管理。
图解软件项目管理加强的部分:
软件项目的商业背景, 项目的平衡术, 关键路径的管理。
这个模式一直没有好好的理解。最近作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