RSS 2.0 Feed
2005-01 Entries
摘要:很荣幸地又被选为MVP,看着MVP队伍日益壮大,我以成为其中一员而感到骄傲,Thanks Microsoft! 另,我女儿很喜欢这次礼物中的128 MB Creative NOMAD MuVo TX,...[阅读全文]

posted @ | Feedback (57) |

摘要:TheServerSide.NET采访Ward Cunningham中的一段对话 【问】 I've got to ask this question. You are a gentleman of some stature within the community and you sort of close your eyes and imagine for a moment you are at a conference and a young programmer comes up to you and says "Mr. Cunningham I love your work, I am such a fan and asks that crucial question, "What can you tell me to make me a great programmer?" What advise do you have for this guy, what can you tell him, what things does he need to know, what things does he have to look for?  【答】......[阅读全文]

posted @ | Feedback (11) |

摘要:最近在复读Martin Fowler的《Patterns of Enterprise Application Architecture(企业应用架构模式)》,因为当初买的是第一次印刷的版本,现在发现纠错的地方很多。他好像准备写第二卷,在他的网站上能看到那些新的模式。 看到一个网站在备档各种架构模式,除了名字,框架图,以及简单的说明外,还有详细说明这些模式的连接,very interesting Architecture patterns Database ...[阅读全文]

posted @ | Feedback (8) |

摘要:在企业开发里,经常遇到的一个问题是需要做Distributed Transactions。一般推荐的做法是做成ServicedComponent,参考 Transaction ControlWriting Serviced Components 这种做法有几个问题,该组件以及所依赖组件必须是Strong-Named的,在通常的情形下(譬如Web Application里),我们需要手动注册组件。但这样,如果我们改动组件的话,需要停止服务,注销组件,然后重新注册组件。另外,这Transaction是declarative和automatic的,无法用编码精确控制 Transaction,而且declaration是在类的级别上的,无法在方法层次做 Transaction。其原因是,ServicedComponent是基于早期COM+的服务架构之上的,Transactional Context是与Object(对象)密切结合在一起的。 但在几年前随XP推出的COM+ 1.5 (Windows 2003服务器也有支持)里, Transactional Context可以独立于Object(对象)之外,极大地简化了Transactional programming。下面这篇2002年MSDN杂志上由COM+专家Tim Ewald介绍了相关的API (CoEnterServiceDomain/CoLeaveServiceDomain),并且提供了C# wrapper 。 Discover Powerful Low-Level Programming in Windows XP with New COM+ APIs 在.NET 1.1里,同样的功能是由2个类,System.EnterpriseServices.ServiceDomain与System.EnterpriseServices.ServiceConfig,来实现的。 这里是Don Box去年7月12日的blog里的例子, ServiceConfig config = newServiceConfig(); config.Transaction = TransactionOption.Required; ServiceDomain.Enter(config);   MyTxCode(); ServiceDomain.Leave(); 在.NET 2.0里,根据Don,你可以这么做 using (TransactionScope scope = newTransactionScope()) {   MyTxCode();   scope.Consistent = true; } 也请参考Using distributed transactions in .Net 1.x without deriving from ServicedComponent ...[阅读全文]

posted @ | Feedback (15) |