??xml version="1.0" encoding="utf-8" standalone="yes"?>91在线播放网站,亚洲最大黄色,91在线品视觉盛宴免费http://www.aygfsteel.com/pesome/category/5222.htmlzh-cnTue, 27 Feb 2007 17:54:43 GMTTue, 27 Feb 2007 17:54:43 GMT60q次做portal的一些ȝQ二Q?/title><link>http://www.aygfsteel.com/pesome/archive/2006/12/13/87468.html</link><dc:creator>pesome</dc:creator><author>pesome</author><pubDate>Wed, 13 Dec 2006 05:39:00 GMT</pubDate><guid>http://www.aygfsteel.com/pesome/archive/2006/12/13/87468.html</guid><wfw:comment>http://www.aygfsteel.com/pesome/comments/87468.html</wfw:comment><comments>http://www.aygfsteel.com/pesome/archive/2006/12/13/87468.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.aygfsteel.com/pesome/comments/commentRss/87468.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/pesome/services/trackbacks/87468.html</trackback:ping><description><![CDATA[ <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">接着前面的写。上文主要写?/span> <span lang="EN-US">ajax</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">portal</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的使用Q这写集群斚w的体会。现在比较流行的架构是前端</span> <span lang="EN-US">F5</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">做负载均衡,后面</span> <span lang="EN-US">2</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">websphere server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">做成集群Q各自都?/span> <span lang="EN-US">HttpServer</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q每?/span> <span lang="EN-US">HttpServer</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">都向</span> <span lang="EN-US">2</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">was</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">做{发。这h台都能独立完成从</span> <span lang="EN-US">HttpServer</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">was</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的流E。一台出现故障,</span> <span lang="EN-US">F5</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">首先q行切换Q只向正?/span> <span lang="EN-US">server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">HttpServer</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">发vhQ这?/span> <span lang="EN-US">HttpServer</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">再进行切换只向同一?/span> <span lang="EN-US">server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上的</span> <span lang="EN-US">was</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">做{发。这?/span> <span lang="EN-US">portal</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是采用的这U架构,不妨UCؓ架构</span> <span lang="EN-US">A</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">另一U简单点的架构就是只?/span> <span lang="EN-US">F5</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">负蝲均衡Q不?/span> <span lang="EN-US">was</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">集群Q每?/span> <span lang="EN-US">websphere server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上的</span> <span lang="EN-US">HttpServer</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">接受</span> <span lang="EN-US">F5</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">转发的请求,只向?/span> <span lang="EN-US">server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">was</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">转发。这h?/span> <span lang="EN-US">websphere server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">保持独立Q相互间没有数据交换和{发。不妨称为架?/span> <span lang="EN-US">B</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">架构</span> <span lang="EN-US">A</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">B</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">各有优劣Q适合不同的需要,下面q行些比较:</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"> <span lang="EN-US" style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"> <span style="mso-list: Ignore">Ø<span style="FONT: 7pt 'Times New Roman'">         </span></span> </span> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从应用部|上看:</span> <span lang="EN-US"> <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span lang="EN-US">A</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用?/span> <span lang="EN-US">websphere</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">集群Q由一?/span> <span lang="EN-US">DeployManager</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">q行分发Q部|应用,只需部v一ơ,?/span> <span lang="EN-US">DM</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分发到几个节点上。?/span> <span lang="EN-US">B</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">每个</span> <span lang="EN-US">server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">都是独立的,部v应用只能一台台部vQ如?/span> <span lang="EN-US">server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">较少差别q不明显Q如果达?/span> <span lang="EN-US">10</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">C上,一台台部v是一个比较痛苦的事情?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"> <span lang="EN-US" style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"> <span style="mso-list: Ignore">Ø<span style="FONT: 7pt 'Times New Roman'">         </span></span> </span> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">session</span> </b> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上看Q?/span> <span lang="EN-US"> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span lang="EN-US">A</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用?/span> <span lang="EN-US">websphere</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">集群Q可以用集提供的</span> <span lang="EN-US">session</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">复制Q对于一些关键应用(某台服务器宕机,</span> <span lang="EN-US">session</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也必M持的应用Q很有必要。而对于一些能够允?/span> <span lang="EN-US">session</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">丢失的应用,才可以?/span> <span lang="EN-US">B</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。当?/span> <span lang="EN-US">A</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也可以关?/span> <span lang="EN-US">session</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">复制Q因?/span> <span lang="EN-US">session</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">复制不管是用数据库方式q是内存方式QM消耗一定的性能。具体消耗多性能Q就要看不同?/span> <span lang="EN-US">application server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">session</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">复制Ҏ(gu)了,x入了解,可以看集方面的文档Q我也只记得一个比较简单的</span> <span lang="EN-US">round robbin</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">了?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"> <span lang="EN-US" style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"> <span style="mso-list: Ignore">Ø<span style="FONT: 7pt 'Times New Roman'">         </span></span> </span> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从架构复杂性看Q?/span> <span lang="EN-US"> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span lang="EN-US">B</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">更ؓ单,因ؓ没有</span> <span lang="EN-US">DM</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的概念,每台</span> <span lang="EN-US">server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">都保持独立。而用了</span> <span lang="EN-US">DM</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有时也会出现莫名奇妙的问题,q当然是׃不了?/span> <span lang="EN-US">DM</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的机制所_但d也增加了复杂度,q点在后面的教训中进行说明?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"> <span lang="EN-US" style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"> <span style="mso-list: Ignore">Ø<span style="FONT: 7pt 'Times New Roman'">         </span></span> </span> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从水qx展性上看:</span> <span lang="EN-US"> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span lang="EN-US">B</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">肯定更胜一{V只?/span> <span lang="EN-US">F5</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">能支持,多少?/span> <span lang="EN-US">server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">都没关系。?/span> <span lang="EN-US">A</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">多台</span> <span lang="EN-US">server</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">做集,要看</span> <span lang="EN-US">websphere</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">支持的节Ҏ(gu)量,应该不会太大。这个如果哪位同学知道,敬请告知?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当然</span> <span lang="EN-US">A</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">B</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在服务器较多的情况下是可以共存的Q可以考虑几台机器做集,然后集群间做负蝲均衡Q这h可以减少部v的复杂度Q又可以带来较好的水qx展。由于没做过更大型的目Q这个也只是我的假象Q请做过的同学斧正?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span lang="EN-US"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">说一说集中到的问题?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"> <span lang="EN-US" style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"> <span style="mso-list: Ignore">Ø<span style="FONT: 7pt 'Times New Roman'">         </span></span> </span> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">首先是对各节点的同步Q?/span> <span lang="EN-US"> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有时Z方便试Q我们只对其中一个节点进行更改,试通过再放到其它节炏V而如果测试周期较长,有时׃造成节点的不同步Q出现各U各栯名其妙的问题。一个经验就是:<b style="mso-bidi-font-weight: normal">无论如何Q在每天下班前要保证各节点的同步Q不同步的现象不要过夜?/b></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"> <span lang="EN-US" style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"> <span style="mso-list: Ignore">Ø<span style="FONT: 7pt 'Times New Roman'">         </span></span> </span> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">然后是对</span> <span lang="EN-US">DM</span> </b> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的理解:</span> <span lang="EN-US"> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我现在还只是实践阶段Q没有看q相x档。从意义上看Q它控制了相关的配置文gQ如果进行节点同步,׃由它把配|文件同步到它管理的节点上。这寚w|文件的修改提出了要求。我们开始只修改节点的配|文件而没有修?/span> <span lang="EN-US">DM</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的,l果q行节点同步׃覆盖修改的配|文Ӟ带来很多不必要的工作。经验就是:<b style="mso-bidi-font-weight: normal">或者修?/b></span> <b style="mso-bidi-font-weight: normal"> <span lang="EN-US">DM</span> </b> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的配|文Ӟ然后q行节点同步Q或者直接同时修Ҏ(gu)有节点和</span> <span lang="EN-US">DM</span> </b> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的?/span> <span lang="EN-US"> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"> <span lang="EN-US" style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"> <span style="mso-list: Ignore">Ø<span style="FONT: 7pt 'Times New Roman'">         </span></span> </span> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">q有关于</span> <span lang="EN-US">cache</span> </b> <b style="mso-bidi-font-weight: normal"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的:</span> <span lang="EN-US"> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span lang="EN-US">Cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是性能优化的一个有效手Dc在单机环境下,最单的是内存</span> <span lang="EN-US">cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q?/span> <span lang="EN-US">static</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">Map</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">p。而在集群环境中,</span> <span lang="EN-US">cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">变的比较复杂了。首先还是从应用需求入手,是否要保持每台机器的</span> <span lang="EN-US">cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">同步。如果只是信息展C等要求不高?/span> <span lang="EN-US">cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q不需保证</span> <span lang="EN-US">cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的同步,问题也比较简单,自己写内?/span> <span lang="EN-US">cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q或者用开源的</span> <span lang="EN-US">cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">lg?/span> <span lang="EN-US">ehcache,oscache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">{就可以很好的解决问题。而如果需?/span> <span lang="EN-US">cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在几个节点保持同步,需要特D的机制了,</span> <span lang="EN-US">ehcache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">{号U支持分布式</span> <span lang="EN-US">cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q但好像需?/span> <span lang="EN-US">jgroup</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q配|比较麻烦,我没有用q,有用q的同学h教。我本来想?/span> <span lang="EN-US">session</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">保存Q然后进?/span> <span lang="EN-US">session</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">同步Q后?/span> <span lang="EN-US">IBM</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用数据?/span> <span lang="EN-US">cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q即自己写代码,</span> <span lang="EN-US">cache</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在数据库中。这样不需?/span> <span lang="EN-US">session</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">同步Q对象不大,性能也能得到保证Q现在用下来效果q可以?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"> <span lang="EN-US"> <o:p> </o:p> </span> </p> <img src ="http://www.aygfsteel.com/pesome/aggbug/87468.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/pesome/" target="_blank">pesome</a> 2006-12-13 13:39 <a href="http://www.aygfsteel.com/pesome/archive/2006/12/13/87468.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>openfans领域模型驱动的尝?/title><link>http://www.aygfsteel.com/pesome/archive/2006/05/22/47516.html</link><dc:creator>pesome</dc:creator><author>pesome</author><pubDate>Mon, 22 May 2006 10:28:00 GMT</pubDate><guid>http://www.aygfsteel.com/pesome/archive/2006/05/22/47516.html</guid><wfw:comment>http://www.aygfsteel.com/pesome/comments/47516.html</wfw:comment><comments>http://www.aygfsteel.com/pesome/archive/2006/05/22/47516.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.aygfsteel.com/pesome/comments/commentRss/47516.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/pesome/services/trackbacks/47516.html</trackback:ping><description><![CDATA[ <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">领域模型驱动Q?/span> <span lang="EN-US">Domain Driven Design</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q,很热的名词?/span> <span lang="EN-US">Openfans</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q不太热的网站。今天俺借着很热?/span> <span lang="EN-US">ddd</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q给不太热的</span> <span lang="EN-US">openfans</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">再造点ѝ?/span> <span lang="EN-US">Openfans</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">׃多介l了Q网站用</span> <span lang="EN-US">spring+hibernate</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为核心的一堆开源Y件构建。有?/span> <span lang="EN-US">spring</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">IOC</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">hibernate</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">ORM</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q打着</span> <span lang="EN-US">ddd</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的旗号也名正言Z很多。先声明其实俺对</span> <span lang="EN-US">ddd</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的理解也多是道听途说Q没有什么系l的学习q,倒是?/span> <span lang="EN-US">Joe</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">阿牛讨论q几ơ,颇有受益Q他对这个理解还是很深刻的?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">a归正传,p</span> <span lang="EN-US">openfans</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">现在l?/span> <span lang="EN-US">ddd</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">思想攚w过的模型。整体上看还是普通的三层架构体系Q展现层、业务层、持久层。展现层?/span> <span lang="EN-US">spring mvc</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q力囑ց到只是展C相养I避免出现业务逻辑。再具体l分Q就?/span> <span lang="EN-US">jsp</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">面只有展示逻辑Q主要?/span> <span lang="EN-US">jstl</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">完成昄功能?/span> <span lang="EN-US">Controller</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">负责从页面获得参数、把数据传回面、控刉面流传和调用业务层的接口。持久层使用</span> <span lang="EN-US">hibernate</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q在设计上我不是?/span> <span lang="EN-US">dao</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方式为每个对象徏立相应的</span> <span lang="EN-US">dao</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q也不是</span> <span lang="EN-US">ddd</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">推荐的每?/span> <span lang="EN-US">domain</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一?/span> <span lang="EN-US">repository</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q而是分成?/span> <span lang="EN-US">Persistence</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">Fetcher2</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个接口?/span> <span lang="EN-US">Persistence</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理持久相关?/span> <span lang="EN-US">save</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">remove</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Ҏ(gu)Q?/span> <span lang="EN-US">Fetcher</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">则处?/span> <span lang="EN-US">get</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">相关。这样分的原因也很简单,</span> <span lang="EN-US">persistence</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是很E_的,对象都可以共用一个接口如</span> <span lang="EN-US">save</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q?/span> <span lang="EN-US">Object</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q,?/span> <span lang="EN-US">fetcher</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">千变万化,需要分c排序等接口?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">q样设计是与业务层架构相关的。我采用的是</span> <span lang="EN-US">domain</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象Q简U?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q?/span> <span lang="EN-US">+</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一层薄?/span> <span lang="EN-US">façade</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的方式?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理自n的逻辑Q包括持久功能。本w?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是没有持久能力的Q需要依靠注入的</span> <span lang="EN-US">persistence</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">接口Q这里就体现?/span> <span lang="EN-US">Persistence</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">Fetcher</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分开的一个好处,</span> <span lang="EN-US">persistence</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以q一个,l编E带来了方便?/span> <span lang="EN-US">Openfans</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中采用的?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">l承一个抽?/span> <span lang="EN-US">PersistentObject</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">cȝ方式Q这?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方便的获得了注入的能力和持久的能力。这样做有何优缺点还需要做些讨论,Z方便我也先q么用?/span> <span lang="EN-US">PersistentObject</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">代码如下Q?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US">public abstract class PersistentObject implements NeedPersist {</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 1">       </span>private Persistence persistence;</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 1">       </span>public void save() {</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 2">              </span>persistence.save(this);</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 1">       </span>}</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 1">       </span>public void remove() {</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 2">              </span>persistence.remove(this);</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 1">       </span>}</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 1">       </span>public void setPersistence(Persistence persistence) {</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 2">              </span>this.persistence = persistence;</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 1">       </span>}</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 1">       </span>public Persistence getPersistence() {</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 2">              </span>return persistence;</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US"> <span style="mso-tab-count: 1">       </span>}</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span lang="EN-US">}</span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">q样</span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">只需要注?/span> <span lang="EN-US">persistence</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">p得了持久的能力,而且可以把这U能力往下传递?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">获得了持久能力,有Ҏ(gu)q富血模型的想法了Q他能够处理一些业务,做持久然后调用引用对象的业务和持久方?/span> <span lang="EN-US">(</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从另外的角度看持久与业务其实是分不开?/span> <span lang="EN-US">)</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。这h业务装在了领域本nQ更适于用领域对象出发的方式L考问题。领域层?/span> <span lang="EN-US">façade</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">主要是ؓ?/span> <span lang="EN-US">Transaction</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">理和隐?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">接口。这?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的业务方法都可以讄?/span> <span lang="EN-US">friendly</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q仅怺间可见?/span> <span lang="EN-US">Façade</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">放?/span> <span lang="EN-US">domain</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包中Q它负责l?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">注入</span> <span lang="EN-US">persistence bean</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q调?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的接口,提供l?/span> <span lang="EN-US">controller</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一?/span> <span lang="EN-US">use case</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">U别的接口,同时它也代理</span> <span lang="EN-US">fetcher</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的接口?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; LINE-HEIGHT: 150%; mso-char-indent-count: 2.0"> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有了q个架构Q实现v来也不复杂,要配|的</span> <span lang="EN-US">bean</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">很少Q现在还没有使用</span> <span lang="EN-US">spring 2.0</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">配置在容器中Q。设计就?/span> <span lang="EN-US">DO</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">出发Q明它的属性和Ҏ(gu)Q让</span> <span lang="EN-US">hibernate</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">自己生成数据库表?/span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 150%"> <span lang="EN-US"> <span style="mso-tab-count: 1">       </span> </span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">q样设计也算是一ơ尝试吧Q其中肯定有很多考虑不周的地方,需要不断的讨论和改q?/span> </p> <img src ="http://www.aygfsteel.com/pesome/aggbug/47516.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/pesome/" target="_blank">pesome</a> 2006-05-22 18:28 <a href="http://www.aygfsteel.com/pesome/archive/2006/05/22/47516.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>log,exception最佛_?/title><link>http://www.aygfsteel.com/pesome/archive/2006/01/18/28502.html</link><dc:creator>pesome</dc:creator><author>pesome</author><pubDate>Wed, 18 Jan 2006 07:39:00 GMT</pubDate><guid>http://www.aygfsteel.com/pesome/archive/2006/01/18/28502.html</guid><wfw:comment>http://www.aygfsteel.com/pesome/comments/28502.html</wfw:comment><comments>http://www.aygfsteel.com/pesome/archive/2006/01/18/28502.html#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://www.aygfsteel.com/pesome/comments/commentRss/28502.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/pesome/services/trackbacks/28502.html</trackback:ping><description><![CDATA[<P class=MMTopic1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-INDENT: 0cm"><FONT size=6><STRONG><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT size=4><FONT size=5>目l对log和exception的讨论结果。希望更多的人参与讨论?/FONT><BR></FONT>1 </SPAN></SPAN><SPAN lang=EN-US>log</SPAN></STRONG></FONT></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>1.1 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>log.error</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">表示pȝU错?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>1.2 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>log.warn</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">表示应用U错?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>1.3 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">服务初始化或l束?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>log.info<o:p></o:p></FONT></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>1.4 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>log.debug</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">替代</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>out</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">Q?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>debug</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">要判?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>isDebugEnable<o:p></o:p></FONT></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>1.5 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>log.warn("",e)</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">替代</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>e.printstack<o:p></o:p></FONT></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>1.6 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>log4e</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">生成</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>log</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">相关代码</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><FONT face=Arial><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">1.7 </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%">Log</SPAN></FONT><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">信息要保证可L,需记录现场信息Q如当前处理</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>id</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">{?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></STRONG></P> <P class=MMTopic1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-INDENT: 0cm"><FONT size=6><STRONG><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">2 </SPAN></SPAN><SPAN lang=EN-US>exception</SPAN></STRONG></FONT></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><FONT face=Arial><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">2.1 </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%">try catch</SPAN></FONT><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">内的代码不要太长</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>2.2 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">因ؓ性能原因Q?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>try catch</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">放循环?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>2.3 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">量避免</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>catch(Exception)</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">q样的写?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>2.4 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">不同模块定义不同?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>exception<o:p></o:p></FONT></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>2.5 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">创徏应用的基c?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>exception</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">Q特别是有定?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>error code</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">需要的应用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>2.6 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">只要</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>catch</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">p</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>log error message<o:p></o:p></FONT></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><FONT face=Arial><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">2.7 </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%">catch</SPAN></FONT><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">q封装成另一U?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>exception</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">Q如果不</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>nest</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">原来?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>exception</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">p</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>log stackTrace<o:p></o:p></FONT></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>2.8 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">持久?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>throw dataAccessException</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">Q业务层</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>throw checked exception</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">Q展现层只显C?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>exception</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">信息</SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></STRONG></P> <P class=MMTopic2 style="MARGIN: 13pt 0cm; TEXT-INDENT: 0cm"><STRONG><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; mso-bidi-font-family: Arial; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore"><FONT face=Arial>2.9 </FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">规范?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><FONT face=Arial>exception</FONT></SPAN><SPAN style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%; FONT-FAMILY: 黑体; mso-ascii-font-family: Arial">程定义如下Q?/SPAN><SPAN lang=EN-US style="FONT-SIZE: 14pt; LINE-HEIGHT: 173%"><o:p></o:p></SPAN></STRONG></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">业务层不需处理?/SPAN><SPAN lang=EN-US>runtime exception</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q由展现层定义的</SPAN><SPAN lang=EN-US>exception controller</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">捕获Q交l相应的</SPAN><SPAN lang=EN-US>error</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">面昄q记?/SPAN><SPAN lang=EN-US>stack</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">信息。业务层捕获下层?/SPAN><SPAN lang=EN-US>exception</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Qƈ装成业务层?/SPAN><SPAN lang=EN-US>checked exception</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q如?/SPAN><SPAN lang=EN-US>nest</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所捕获?/SPAN><SPAN lang=EN-US>exception</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q则?/SPAN><SPAN lang=EN-US>log error message</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q如果不</SPAN><SPAN lang=EN-US>nest</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">需要用</SPAN><SPAN lang=EN-US>log.warn(“?e)</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">记录</SPAN><SPAN lang=EN-US>stack</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">信息。展现层捕获业务层的</SPAN><SPAN lang=EN-US>exception</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q应由处理业务层</SPAN><SPAN lang=EN-US>exception</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/SPAN><SPAN lang=EN-US>error</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">面来处理?/SPAN></P><img src ="http://www.aygfsteel.com/pesome/aggbug/28502.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/pesome/" target="_blank">pesome</a> 2006-01-18 15:39 <a href="http://www.aygfsteel.com/pesome/archive/2006/01/18/28502.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>pȝ架构的思?/title><link>http://www.aygfsteel.com/pesome/archive/2005/11/24/21333.html</link><dc:creator>pesome</dc:creator><author>pesome</author><pubDate>Thu, 24 Nov 2005 11:25:00 GMT</pubDate><guid>http://www.aygfsteel.com/pesome/archive/2005/11/24/21333.html</guid><wfw:comment>http://www.aygfsteel.com/pesome/comments/21333.html</wfw:comment><comments>http://www.aygfsteel.com/pesome/archive/2005/11/24/21333.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/pesome/comments/commentRss/21333.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/pesome/services/trackbacks/21333.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">今天?/SPAN><SPAN lang=EN-US>SUN</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的高U工E师有了些交,感触颇多。首先要谈到它的一个品(其实不能叫品)</SPAN><SPAN lang=EN-US>JEF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q也是</SPAN><SPAN lang=EN-US>Java Enterprise Framework</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/SPAN><SPAN lang=EN-US>JEF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以说是很多框架和组件的有机l合Q有</SPAN><SPAN lang=EN-US>opensource</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的,有商业的Q也?/SPAN><SPAN lang=EN-US>sun</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">自己写的Q其实也?/SPAN><SPAN lang=EN-US>SUN</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在多个大规模目中不断实늚基础上发展v来的。它通过定义良好的分层和装Q能够提供应用开发非常坚实的基础。下图是</SPAN><SPAN lang=EN-US>JEF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的整体架构图Q?BR><BR><IMG height=277 alt=r_clip_image002.gif src="http://www.aygfsteel.com/images/blogjava_net/pesome/5223/r_clip_image002.gif" width=624 border=0><BR><BR></SPAN><SPAN lang=EN-US><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"> <SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"> <IMG height=1 src="/FreeTextBox/Utility/spacer.gif" width=1><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype></SPAN><BR><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有机会再q行对它整体架构和各个组件功能的详谈吧?/SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">再谈一谈对真正的系l架构师的认识?/SPAN><SPAN lang=EN-US>JEF</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/SPAN><SPAN lang=EN-US>2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个主要设计者我都见q了Q都是香港hQ都温文雅Q学识渊博,l验丰富。能够聆听它们对软g架构的理解,寚w目实际问题的分析和解冻I真的是受益匪,对自己将来进行设计时思考问题的深度和广度都有很大的提高。这才是真正的架构师Q他需要对各种框架Q组仉了如指掌Q在面对具体的项目需求时能正的选择最适用的技术;他需要对软g整体架构有清晰的认识和理解,知道在面对实际项目时该用何U架构,包括</SPAN><SPAN lang=EN-US>thin client</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">q是</SPAN><SPAN lang=EN-US>rich client</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q?/SPAN><SPAN lang=EN-US>with EJB</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">q是</SPAN><SPAN lang=EN-US>without EJB</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">{等Q他需要有一U严谨求证的性格Q对M东西不是盲目下结论,而是Ҏ(gu)具体的分析和实证q行取舍。。。。。。通往真正的架构师的\q很长,需要经历的目Q需要做的事情还很多。我们不能盲目尊大(?/SPAN><SPAN lang=EN-US>spring</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q?/SPAN><SPAN lang=EN-US>hibernate</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">做个项目就以ؓ很牛Q,也不能׃心(l验和领会都是靠目做出来的Q。我们应该时M持向上的心态,M动参与项目,L通,M,LȝQ去思考。即使将来成不了真正的架构师Q我们也可以自豪的说Q“我每一步都是踏实的C来的Q我每一个项目都是用心在做的Q我的代码都是注释详实,单易懂,为后来者提供很好的可重用基的而不是被人咒骂的Q我做的是可用的软g而不是垃圾Y件。”希望与所有有志于成ؓ真正的系l架构师的同学共勉?/SPAN></P><img src ="http://www.aygfsteel.com/pesome/aggbug/21333.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/pesome/" target="_blank">pesome</a> 2005-11-24 19:25 <a href="http://www.aygfsteel.com/pesome/archive/2005/11/24/21333.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">԰</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">Ϲ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƶ</a>| <a href="http://" target="_blank">μ</a>| <a href="http://" target="_blank">Ϲ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¡</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ӱ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʯ̨</a>| <a href="http://" target="_blank">ƺ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">³ľ</a>| <a href="http://" target="_blank">â</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">»</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ޭ</a>| <a href="http://" target="_blank">ǡ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">µ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">÷</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>