??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品国产亚洲AV嫖农村妇女,亚洲精品国产手机,亚洲精品乱码久久久久久中文字幕 http://www.tkk7.com/msmary/category/26490.html书山有\勤ؓ径,学v无苦作?/description>zh-cnThu, 25 Oct 2007 12:42:23 GMTThu, 25 Oct 2007 12:42:23 GMT60AOP是什?/title><link>http://www.tkk7.com/msmary/articles/155418.html</link><dc:creator>谭明</dc:creator><author>谭明</author><pubDate>Tue, 23 Oct 2007 14:55:00 GMT</pubDate><guid>http://www.tkk7.com/msmary/articles/155418.html</guid><wfw:comment>http://www.tkk7.com/msmary/comments/155418.html</wfw:comment><comments>http://www.tkk7.com/msmary/articles/155418.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/msmary/comments/commentRss/155418.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/msmary/services/trackbacks/155418.html</trackback:ping><description><![CDATA[<p>  </p> <p style="line-height: 150%; text-align: left" align="left"><strong><span style="color: #212121; font-family: 宋体">Z么要区分</span></strong><strong><span style="color: #212121; font-family: Verdana">J2EE</span></strong><strong><span style="color: #212121; font-family: 宋体">容器?/span></strong><strong><span style="color: #212121; font-family: Verdana">J2EE</span></strong><strong><span style="color: #212121; font-family: 宋体">应用pȝQ?/span></strong></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  我们知道Q?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">应用pȝ只有部v?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">容器中才能运行,那么Z么划分ؓ</span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">容器?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">应用pȝQ?/span><span style="color: #212121; line-height: 150%; font-family: 宋体">通过?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">容器q行机制的分析(见我的电子教?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">“EJB</span><span style="color: #212121; line-height: 150%; font-family: 宋体">实用原理</span><span style="color: #212121; line-height: 150%; font-family: Verdana">”</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Q,我们可以发现Q实际上</span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">容器分离了一般应用系l的一些通用功能Q例如事务机制、安全机制以及对象池或线E池{性能优化机制?/span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  q些功能机制是每个应用系l几乎都需要的Q因此可以从具体应用pȝ中分d来,形成一个通用的框架^収ͼ而且Q这些功能机制的设计开发有一定难度,同时q行的稳定性和快速性都非常重要Q必ȝq长旉调试和运行经验积累而成Q因此,形成了专门的</span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">容器服务器品,?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">Tomcat JBoss</span><span style="color: #212121; line-height: 150%; font-family: 宋体">?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">Websphere</span><span style="color: #212121; line-height: 150%; font-family: 宋体">?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">WebLogic</span><span style="color: #212121; line-height: 150%; font-family: 宋体">{?/span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  ?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">pȝ划分?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">容器?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">应用pȝ两个斚wQ我们已l看CU分散关注的思\Q?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">separation of concerns</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Q?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> <br /> </span><strong><span style="color: #212121; font-family: 宋体">分散x</span></strong><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> <br /> </span><span style="color: #212121; line-height: 150%; font-family: 宋体">  通用需求功能从不相关类之中分离出来Q同Ӟ能够使得很多cd享一个行为,一旦行为发生变化,不必修改很多c,只要修改q个行ؓ可以?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> <br /> </span><span style="color: #212121; line-height: 150%; font-family: 宋体">  </span><span style="color: #212121; line-height: 150%; font-family: Verdana"> AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">是q种实现分散x的编E方法,它将</span><span style="color: #212121; line-height: 150%; font-family: Verdana">“</span><span style="color: #212121; line-height: 150%; font-family: 宋体">x</span><span style="color: #212121; line-height: 150%; font-family: Verdana">”</span><span style="color: #212121; line-height: 150%; font-family: 宋体">装?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">“</span><span style="color: #212121; line-height: 150%; font-family: 宋体">斚w</span><span style="color: #212121; line-height: 150%; font-family: Verdana">”</span><span style="color: #212121; line-height: 150%; font-family: 宋体">中?/span></p> <p style="line-height: 150%; text-align: left" align="left"><strong><span style="color: #212121; font-family: Verdana">AOP</span></strong><strong><span style="color: #212121; font-family: 宋体">是什么?</span></strong></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  </span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">OOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">的gl,?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">Aspect Oriented Programming</span><span style="color: #212121; line-height: 150%; font-family: 宋体">的羃写,意思是面向斚w~程?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">实际?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">GoF</span><span style="color: #212121; line-height: 150%; font-family: 宋体">设计模式的gl,设计模式孜孜不倦追求的是调用者和被调用者之间的解耦,</span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">可以说也是这U目标的一U实现?/span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  举例Q假设有在一个应用系l中Q有一个共享的数据必须被ƈ发同时访问,首先Q将q个数据装在数据对象中Q称?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">Data Class</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Q同Ӟ有多个讉Kc,专门用于在同一时刻讉Kq同一个数据对象?/span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  Z完成上述q发讉K同一资源的功能,需要引入锁</span><span style="color: #212121; line-height: 150%; font-family: Verdana">Lock</span><span style="color: #212121; line-height: 150%; font-family: 宋体">的概念,也就是说Q某个时刻,当有一个访问类讉Kq个数据对象Ӟq个数据对象必须上锁</span><span style="color: #212121; line-height: 150%; font-family: Verdana">Locked</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Q用完后q卌?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">unLocked</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Q再供其它访问类讉K?/span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  使用传统的编E习惯,我们会创Z个抽象类Q所有的讉Kcȝ承这个抽象父c,如下Q?/span></p> <div align="center"> <table style="width: 80%" cellspacing="0" cellpadding="0" width="80%" border="0"> <tbody> <tr> <td style="padding-right: 0cm; padding-left: 0cm; background: #cccccc; padding-bottom: 0cm; padding-top: 0cm"> <p style="text-align: left" align="left"><span style="font-size: 9pt; color: black; font-family: Verdana">abstract class Worker{</span></p> <p style="text-align: left" align="left"><span style="font-size: 9pt; color: black; font-family: 宋体">  </span><span style="font-size: 9pt; color: black; font-family: Verdana">abstract void locked();<br /> </span><span style="font-size: 9pt; color: black; font-family: 宋体">  </span><span style="font-size: 9pt; color: black; font-family: Verdana">abstract void accessDataObject();<br /> </span><span style="font-size: 9pt; color: black; font-family: 宋体">  </span><span style="font-size: 9pt; color: black; font-family: Verdana">abstract void unlocked();</span></p> <p style="text-align: left" align="left"><span style="font-size: 9pt; color: black; font-family: Verdana">}</span></p> </td> </tr> </tbody> </table> </div> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> </span><span style="color: #212121; line-height: 150%; font-family: 宋体">  ~点Q?/span></p> <ul type="square"> <li style="color: black; line-height: 150%; text-align: left; tab-stops: list 36.0pt"><span style="line-height: 150%; font-family: Verdana">accessDataObject()</span><span style="line-height: 150%; font-family: 宋体">Ҏ需要有</span><span style="line-height: 150%; font-family: Verdana">“</span><span style="line-height: 150%; font-family: 宋体">?/span><span style="line-height: 150%; font-family: Verdana">”</span><span style="line-height: 150%; font-family: 宋体">状态之cȝ相关代码?/span></li> <li style="color: black; line-height: 150%; text-align: left; tab-stops: list 36.0pt"><span style="line-height: 150%; font-family: Verdana">Java</span><span style="line-height: 150%; font-family: 宋体">只提供了单承,因此具体讉Kcd能承这个父c,如果具体讉Kc还要承其它父c,比如另外一个如</span><span style="line-height: 150%; font-family: Verdana">Worker</span><span style="line-height: 150%; font-family: 宋体">的父c,无法方便实现?/span></li> <li style="color: black; line-height: 150%; text-align: left; tab-stops: list 36.0pt"><span style="line-height: 150%; font-family: 宋体">重用被打折扣Q具体访问类因ؓ也包?/span><span style="line-height: 150%; font-family: Verdana">“</span><span style="line-height: 150%; font-family: 宋体">?/span><span style="line-height: 150%; font-family: Verdana">”</span><span style="line-height: 150%; font-family: 宋体">状态之cȝ相关代码Q只能被重用在相x</span><span style="line-height: 150%; font-family: Verdana">“</span><span style="line-height: 150%; font-family: 宋体">?/span><span style="line-height: 150%; font-family: Verdana">”</span><span style="line-height: 150%; font-family: 宋体">的场合,重用范围很窄?/span><span style="line-height: 150%; font-family: Verdana"><br /> <br /> </span><span style="line-height: 150%; font-family: 宋体">仔细研究q个应用?/span><span style="line-height: 150%; font-family: Verdana">“</span><span style="line-height: 150%; font-family: 宋体">?/span><span style="line-height: 150%; font-family: Verdana">”</span><span style="line-height: 150%; font-family: 宋体">Q它其实有下列特性:</span></li> <li style="color: black; line-height: 150%; text-align: left; tab-stops: list 36.0pt"><span style="line-height: 150%; font-family: Verdana">“</span><span style="line-height: 150%; font-family: 宋体">?/span><span style="line-height: 150%; font-family: Verdana">”</span><span style="line-height: 150%; font-family: 宋体">功能不是具体讉Kcȝ首要或主要功能,讉KcM要功能是讉K数据对象Q例如读取数据或更改动作?/span></li> <li style="color: black; line-height: 150%; text-align: left; tab-stops: list 36.0pt"><span style="line-height: 150%; font-family: Verdana">“</span><span style="line-height: 150%; font-family: 宋体">?/span><span style="line-height: 150%; font-family: Verdana">”</span><span style="line-height: 150%; font-family: 宋体">行ؓ其实是和具体讉Kcȝ主要功能可以独立、区分开来的?/span></li> <li style="color: black; line-height: 150%; text-align: left; tab-stops: list 36.0pt"><span style="line-height: 150%; font-family: Verdana">“</span><span style="line-height: 150%; font-family: 宋体">?/span><span style="line-height: 150%; font-family: Verdana">”</span><span style="line-height: 150%; font-family: 宋体">功能其实是这个系l的一个纵向切面,涉及许多cR许多类的方法。如下图Q?/span><span style="line-height: 150%; font-family: Verdana"><br /> </span></li> </ul> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  因此<img height="258" alt="" src="http://www.tkk7.com/images/blogjava_net/msmary/lock.png" width="250" border="0" />Q一个新的程序结构应该是xpȝ的纵向切面,例如q个应用?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">“</span><span style="color: #212121; line-height: 150%; font-family: 宋体">?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">”</span><span style="color: #212121; line-height: 150%; font-family: 宋体">功能Q这个新的程序结构就?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">aspect</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Q方面)</span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  在这个应用中Q?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">“</span><span style="color: #212121; line-height: 150%; font-family: 宋体">?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">”</span><span style="color: #212121; line-height: 150%; font-family: 宋体">斚wQ?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">aspect</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Q应该有以下职责Q?/span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  提供一些必备的功能Q对被访问对象实现加锁或解锁功能。以保证所有在修改数据对象的操作之前能够调?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">lock()</span><span style="color: #212121; line-height: 150%; font-family: 宋体">加锁Q在它用完成后Q调?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">unlock()</span><span style="color: #212121; line-height: 150%; font-family: 宋体">解锁?/span></p> <p style="line-height: 150%; text-align: left" align="left"><strong><span style="color: #212121; font-family: Verdana">AOP</span></strong><strong><span style="color: #212121; font-family: 宋体">应用范围</span></strong><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> <br /> </span><span style="color: #212121; line-height: 150%; font-family: 宋体">  很明显,</span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">非常适合开?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">容器服务器,目前</span><span style="color: #212121; line-height: 150%; font-family: Verdana">JBoss 4.0</span><span style="color: #212121; line-height: 150%; font-family: 宋体">正是使用</span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">框架q行开发?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> </span><span style="color: #212121; line-height: 150%; font-family: 宋体">  具体功能如下Q?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> Authentication </span><span style="color: #212121; line-height: 150%; font-family: 宋体">权限</span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> Caching </span><span style="color: #212121; line-height: 150%; font-family: 宋体">~存</span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> Context passing </span><span style="color: #212121; line-height: 150%; font-family: 宋体">内容传?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> Error handling </span><span style="color: #212121; line-height: 150%; font-family: 宋体">错误处理</span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> Lazy loading</span><span style="color: #212121; line-height: 150%; font-family: 宋体"> 懒加?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> Debugging</span><span style="color: #212121; line-height: 150%; font-family: 宋体">  调试</span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> logging, tracing, profiling and monitoring</span><span style="color: #212121; line-height: 150%; font-family: 宋体"> 记录跟踪 优化 校准</span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> Performance optimization</span><span style="color: #212121; line-height: 150%; font-family: 宋体"> 性能优化</span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> Persistence</span><span style="color: #212121; line-height: 150%; font-family: 宋体">  持久?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> Resource pooling</span><span style="color: #212121; line-height: 150%; font-family: 宋体"> 资源?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> Synchronization</span><span style="color: #212121; line-height: 150%; font-family: 宋体"> 同步</span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> Transactions </span><span style="color: #212121; line-height: 150%; font-family: 宋体">事务</span></p> <p style="line-height: 150%; text-align: left" align="left"><strong><span style="color: #212121; font-family: Verdana">AOP</span></strong><strong><span style="color: #212121; font-family: 宋体">有必要吗Q?/span></strong></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  当然Q上q应用范例在没有使用</span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">情况下,也得C解决Q例?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">JBoss 3.XXX</span><span style="color: #212121; line-height: 150%; font-family: 宋体">也提供了上述应用功能Q但是没有?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">?/span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  但是Q?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">可以让我们从一个更高的抽象概念来理解Y件系l,</span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">也许提供一U有价值的工具。可以这么说Q因Z?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">l构Q现?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">JBoss 4.0</span><span style="color: #212121; line-height: 150%; font-family: 宋体">的源码要?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">JBoss 3.X</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Ҏ理解多了Q这对于一个大型复杂系l来说是非常重要的?/span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  从另外一个方面说Q好像不是所有的人都需要关?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Q它可能是一U架构设计的选择Q如果选择</span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">pȝQ?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">x的上q通用斚w都已l被</span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">容器实现了,</span><span style="color: #212121; line-height: 150%; font-family: Verdana">J2EE</span><span style="color: #212121; line-height: 150%; font-family: 宋体">应用pȝ开发者可能需要更多地x行业应用斚w</span><span style="color: #212121; line-height: 150%; font-family: Verdana">aspect</span><span style="color: #212121; line-height: 150%; font-family: 宋体">?/span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> </span><strong><span style="color: #212121; font-family: Verdana">AOP</span></strong><strong><span style="color: #212121; font-family: 宋体">具体实现</span></strong></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  </span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">是一个概念,q没有设定具体语a的实玎ͼ它能克服那些只有单承特性语a的缺点(?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">Java</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Q,目前</span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">具体实现有以下几个项目:</span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  </span><span style="color: #212121; line-height: 150%; font-family: Verdana">AspectJ (TM)</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Q 创徏?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">Xerox PARC. </span><span style="color: #212121; line-height: 150%; font-family: 宋体">有近十年历史Q成?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> </span><span style="color: #212121; line-height: 150%; font-family: 宋体">  ~点Q过于复杂;破坏装Q需要专门的</span><span style="color: #212121; line-height: 150%; font-family: Verdana">Java</span><span style="color: #212121; line-height: 150%; font-family: 宋体">~译器?/span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">  动?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">Q?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">JDK</span><span style="color: #212121; line-height: 150%; font-family: 宋体">的动态代?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">API</span><span style="color: #212121; line-height: 150%; font-family: 宋体">或字节码</span><span style="color: #212121; line-height: 150%; font-family: Verdana">Bytecode</span><span style="color: #212121; line-height: 150%; font-family: 宋体">处理技术?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> <br /> </span><span style="color: #212121; line-height: 150%; font-family: 宋体">  Z动态代?/span><span style="color: #212121; line-height: 150%; font-family: Verdana">API</span><span style="color: #212121; line-height: 150%; font-family: 宋体">的具体项目有Q?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> <a target="_blank"><span style="color: #003366; line-height: 150%; font-family: 宋体; text-decoration: none; text-underline: none">  </span><span style="color: #003366; line-height: 150%; text-decoration: none; text-underline: none">JBoss 4.0</span></a> JBoss 4.0</span><span style="color: #212121; line-height: 150%; font-family: 宋体">服务?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> <a target="_blank"><span style="color: #003366; line-height: 150%; font-family: 宋体; text-decoration: none; text-underline: none">  </span><span style="color: #003366; line-height: 150%; text-decoration: none; text-underline: none">nanning</span></a></span><span style="color: #212121; line-height: 150%; font-family: 宋体"> q是以中国南宁命名的一个项目,搞不清楚Z么和中国相关Q是中国人发LQ?/span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> <br /> </span><span style="color: #212121; line-height: 150%; font-family: 宋体">  Z字节码的目有:</span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> <a target="_blank"><span style="color: #003366; line-height: 150%; font-family: 宋体; text-decoration: none; text-underline: none">  </span><span style="color: #003366; line-height: 150%; text-decoration: none; text-underline: none">aspectwerkz</span></a></span><span style="color: #212121; line-height: 150%; font-family: 宋体"> </span><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> <a target="_blank"><span style="color: #003366; line-height: 150%; font-family: 宋体; text-decoration: none; text-underline: none">  </span><span style="color: #003366; line-height: 150%; text-decoration: none; text-underline: none">spring</span><span style="color: #003366; line-height: 150%; font-family: 宋体; text-decoration: none; text-underline: none"> Q?/span></a></span></p> <p style="line-height: 150%; text-align: left" align="left"><span style="color: #212121; line-height: 150%; font-family: 宋体">在以后其它文章中Q我l对</span><span style="color: #212121; line-height: 150%; font-family: Verdana">AOP</span><span style="color: #212121; line-height: 150%; font-family: 宋体">概念q行分析Q和大家一起学习进步?/span></p> <p style="line-height: 150%; text-align: left" align="left"><strong><span style="color: #212121; font-family: 宋体">参考资料:</span></strong><span style="color: #212121; line-height: 150%; font-family: Verdana"><br /> <a target="_blank"><span style="color: #003366; line-height: 150%; text-decoration: none; text-underline: none">http://www.voelter.de/data/articles/aop/aop.html</span></a><br /> <a target="_blank"><span style="color: #003366; line-height: 150%; text-decoration: none; text-underline: none">Aspect-Oriented_Java_Development.pdf</span></a></span></p> <img src ="http://www.tkk7.com/msmary/aggbug/155418.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/msmary/" target="_blank">谭明</a> 2007-10-23 22:55 <a href="http://www.tkk7.com/msmary/articles/155418.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>J2EE架构数据表示QStrutsQHibernate http://www.tkk7.com/msmary/articles/153410.html谭明谭明Tue, 16 Oct 2007 16:07:00 GMThttp://www.tkk7.com/msmary/articles/153410.htmlhttp://www.tkk7.com/msmary/comments/153410.htmlhttp://www.tkk7.com/msmary/articles/153410.html#Feedback0http://www.tkk7.com/msmary/comments/commentRss/153410.htmlhttp://www.tkk7.com/msmary/services/trackbacks/153410.html 

在struts+hibernateq种l构中,是不应该把Hibernate产生的PO直接传递给JSP的,不管他是IteratorQ还是ListQ这是一个设计错误?

我来谈谈在J2EE架构中各层的数据表示ҎQ?

◆Web层的数据表示是FormBeanQ数据来源于HTML Form POST

◆业务层的数据表C是VO

◆持久层的数据表C是POQ其数据来源于数据库Q持久层的数据表CZ如CMP

在一个规范的J2EE架构中,不同层的数据表示应该被限制在层内Q而不应该扩散到其它层Q这样可以降低层间的耦合性,提高J2EE架构整体的可l护性和可扩展性。比如说Web层的逻辑q行了修改,那么只需要修改FormBean的结构,而不需要触动业务层和持久层的代码修攏V同LQ当数据库表q行了小的调_那么也只需要修Ҏ久层数据表示Q而不需要触动业务层代码和Web层代码?

不过׃Hibernate的强大功能,例如动态生成POQPO的状态管理可以脱SessionQ得在应用了Hibernate的J2EE框架中,PO完全可以充当VOQ因此我们下面把PO和VO合ƈQ统UCؓPO?

先来谈谈ActionFormBean和持久层的PO之间的重大区别:

在简单的应用中,ActionFormBean和PO几乎是没有区别,所以很多hq脆是用ActionFormBean来充当POQ于是ActionFormBean从JSP面到Servlet控制层再C务层Q然后穿q持久层Q最后一直映到数据库表。真是一竿子捅到了底Q?

但是在复杂的应用中,ActionFormBean和PO是分ȝQ他们也不可能一栗ActionFormBean是和|页里面的Form表单一一对应的,Form里面有什么元素,Bean里面有什么属性。而PO和数据库表对应,因此如果数据库表不修改,那么PO也不会修改,如果面的流E和数据库表字段对应关系不一_那么你又如何能够使用ActionFormBean来取代PO呢?

比如说吧Q用h册页面要求注册用L基本信息Q因此HTML Form里面包含了基本信息属性,于是你需要一个ActionFormBean来一一对应(注意Q是一一对应)Q每个Bean属性对应一个文本框或者选择框什么的?

而用戯个持久对象呢Q他的属性和ActionFormBean有什么明显不同呢Q他会有一些ActionFormBean所没有的集合属性,比如说用L权限属性,用户的组属性,用户的帖子等{。另外还有可能的是在ActionFormBean里面?个属性,分别是用LFirst Name, Middle Name, Last NameQ而在我的Userq个持久对象中就是一个Name对象属性?

假设我的注册面原来只要你提供First NameQ那么ActionFormBeanp一个属性,后来我要你提供全名,你要改ActionFormBeanQ加两个属性。但是这个时候PO是不应该修改_因ؓ数据库没有改?

那么在一个完整的J2EEpȝ中应该如何进行合理的设计呢?

JSP(View) ---> Action Form Bean (Module) ---> Action(Control)

Action Form Bean是Web层的数据表示Q它和HTML面Form对应Q只要Web面的操作流E发生改变,它就要相应的q行修改Q它不应该也不能被传递到业务层和持久层,否则一旦页面修改,会一直牵q到业务层和持久层的大面U的代码q行修改Q对于Y件的可维护性和可扩展性而言Q是一个灾难,Actiont是他的边界Q到此ؓ止!

Action(Web Control) ---> Business Bean ---> DAO ---> ORM --->DB

而PO则是业务层和持久层的数据表示Q它在业务层和持久层之间q行动Q他不应该也不能被传递到Web层的View中去Q而ActionServlet是他的边界Q到此ؓ止!

然后来看一看整个架构的程Q?

当用户通过览器访问网,提交了一个页面。于是Action拿到了这个FormBeanQ他会把FormBean属性读出来Q然后构造一个PO对象Q再调用业务层的Beanc,完成了注册操作,重定向到成功面。而业务层Bean收到q个PO对象之后Q调用DAO接口ҎQ进行持久对象的持久化操作?

当用h询某个会员的信息的时候,他用全名q行查询Q于是Action得到一个UserNameFormBean包括?个属性,分别是first name, middle name, last nameQ然后Action把UserNameFormBean?个属性读出来Q构造Name对象Q再调用业务BeanQ把Name对象传递给业务BeanQ进行查询?

业务Bean取得Name(注意:Name对象只是User的一个属?对象之后调用DAO接口Q返回一个User的PO对象Q注意这个User不同于在Web层用的UserFormBeanQ他有很多集合属性的。然后业务Bean把User对象q回lAction?

Action拿到User之后Q把User的基本属性取?集合属性如果不需要就免了)Q构造UserFormBeanQ然后把UserFormBean request.setAttribute(...)Q然后重定向到查询结果页面?

查询面拿到request对象里面的ActionFormBeanQ自动调用tag昄之?

ȝQ?

Form Bean是Web层的数据表示Q他不能被传递到业务层;PO是持久层的数据表C,在特定情况下Q例如Hibernate中,他可以取代VO出现在业务层Q但是不POq是VO都必限制在业务层内使用Q最多到达Web层的ControlQ绝不能被扩散到View厅R?

Form Bean和PO之间的数据{化是在Action中进行的?

BTWQ顺便说一句)Q?

JDO1.xq不能像Hibernate功能q样强大QPO不能q持久层,所以必d业务层用VOQ因此必d业务层进行大量的VO和PO的{化操作,相对于Hibernate来说Q编E比较烦琐?

当然了,理论是一回事Q实际操作也不一定非要这样干Q你可以自行取舍Q在实际目中灵zM点,增加一点bad smellQ提高开发效率。只不过在大型项目中最好还是严丝合~,不然的话Q改版的时候会痛苦的很的?



谭明 2007-10-17 00:07 发表评论
]]>
J2EE 全面??http://www.tkk7.com/msmary/articles/152154.html谭明谭明Thu, 11 Oct 2007 13:33:00 GMThttp://www.tkk7.com/msmary/articles/152154.htmlhttp://www.tkk7.com/msmary/comments/152154.htmlhttp://www.tkk7.com/msmary/articles/152154.html#Feedback0http://www.tkk7.com/msmary/comments/commentRss/152154.htmlhttp://www.tkk7.com/msmary/services/trackbacks/152154.html
一. J2EE的概?br /> 目前QJava 2q_?个版本,它们是适用于小型设备和卡的Java 2q_Micro版(Java 2 Platform Micro EditionQJ2MEQ、适用于桌面系l的Java 2q_标准版(Java 2 Platform Standard EditionQJ2SEQ、适用于创建服务器应用E序和服务的Java2q_企业版(Java 2 Platform Enterprise EditionQJ2EEQ?br /> J2EE是一U利用Java 2q_来简化企业解x案的开发、部|和理相关的复杂问题的体系l构。J2EE技术的基础是核心Javaq_或Java 2q_的标准版QJ2EE不仅巩固了标准版中的许多优点Q例?~写一ơ、随处运?的特性、方便存取数据库的JDBC API、CORBA技术以及能够在Internet应用中保护数据的安全模式{等Q同时还提供了对 EJBQEnterprise JavaBeansQ、Java Servlets API、JSPQJava Server PagesQ以及XML技术的全面支持。其最l目的就是成Z个能够企业开发者大q羃短投攑ָ场时间的
体系l构?br /> J2EE体系l构提供中间层集成框架用来满x需太多费用而又需要高可用性、高可靠性以及可扩展性的应用的需求。通过提供l一的开发^収ͼJ2EE降低了开发多层应用的费用和复杂性,同时提供对现有应用程序集成强有力支持Q完全支持Enterprise JavaBeansQ有良好的向导支持打包和部v应用Q添加目录支持,增强了安全机Ӟ提高了性能?br />
? J2EE的优?br /> J2EE为搭建具有可伸羃性、灵zL、易l护性的商务pȝ提供了良好的机制:
保留现存的IT资: ׃企业必须适应新的商业需求,利用已有的企业信息系l方面的投资Q而不是重新制定全盘方案就变得很重要。这P一个以渐进的(而不是激q的Q全盘否定的Q方式徏立在已有pȝ之上的服务器端^台机制是公司所需求的。J2EE架构可以充分利用用户原有的投资,如一些公怋用的BEA Tuxedo、IBM CICS, IBM Encina,、Inprise VisiBroker 以及Netscape Application Server。这之所以成为可能是因ؓJ2EE拥有q泛的业界支持和一些重要的'企业计算'领域供应商的参与。每一个供应商都对现有的客h供了不用废弃已有投资Q进入可UL的J2EE领域的升U途径。由于基于J2EEq_的品几乎能够在M操作pȝ和硬仉|上q行Q现有的操作pȝ和硬件也
能被保留使用?br /> 高效的开? J2EE允许公司把一些通用的、很J琐的服务端d交给中间件供应商d成。这样开发h员可以集中精力在如何创徏商业逻辑上,相应地羃短了开发时间。高U中间g供应商提供以下这些复杂的中间件服?
状态管理服?-- 让开发h员写更少的代码,不用兛_如何理状态,q样能够更快地完成程序开发?br /> 持箋性服?-- 让开发h员不用对数据讉K逻辑q行~码p~写应用E序Q能生成?br /> dyQ与数据库无关的应用E序Q这U应用程序更易于开发与l护?br /> 分布式共享数据对象CACHE服务 -- 让开发h员编刉性能的系l,极大提高整体部v?br /> 伸羃性?br /> 支持异构环境: J2EE能够开发部|在异构环境中的可移植程序。基于J2EE的应用程序不
依赖M特定操作pȝ、中间g、硬件。因此设计合理的ZJ2EE的程序只需开发一?br /> 可部v到各U^台。这在典型的异构企业计算环境中是十分关键的。J2EE标准也允?br /> 客户订购与J2EE兼容的第三方的现成的lgQ把他们部v到异构环境中Q节省了p?br /> 制订整个Ҏ所需的费用?br /> 可׾~? 企业必须要选择一U服务器端^収ͼq种q_应能提供极佳的可伸羃性去满那些在他们系l上q行商业q作的大Ҏ客户。基于J2EEq_的应用程序可被部|到各种操作pȝ上。例如可被部|到高端UNIX与大型机pȝQ这U系l单机可支持64?56个处理器。(q是NT服务器所望尘莫及的)J2EE领域的供应商提供了更为广泛的负蝲q{略。能消除pȝ中的瓉Q允许多台服务器集成部v。这U部|可达数千个处理器,实现可高度׾~的pȝQ满x来商业应用的需要?br /> E_的可用? 一个服务器端^台必能全天候运转以满公司客户、合作伙伴的需要。因为INTERNET是全球化的、无处不在的Q即使在夜间按计划停Z可能造成严重损失。若是意外停机,那会有灾难性后果。J2EE部v到可靠的操作环境中,他们支持长期的可用性。一些J2EE部v在WINDOWS环境中,客户也可选择健壮性能更好的操作系l如Sun Solaris、IBM OS/390。最健壮的操作系l可辑ֈ99.999%的可用性或每年只需5分钟停机旉。这是实时性很强商业系l理想的选择?br />

? J2EE 的四层模?br /> J2EE使用多层的分布式应用模型Q应用逻辑按功能划分ؓlgQ各个应用组件根据他?br /> 所在的层分布在不同的机器上。事实上Qsun设计J2EE的初h是ؓ了解决两层模?cl
ient/server)的弊端,在传l模式中Q客L担当了过多的角色而显得臃肿,在这U模
式中Q第一ơ部|的时候比较容易,但难于升U或改进Q可伸展性也不理惻I而且l常
Z某种专有的协议――通常是某U数据库协议。它使得重用业务逻辑和界面逻辑非常
困难。现在J2EE 的多层企业应用模型两层化模型中的不同层面切分成许多层。一?br /> 多层化应用能够ؓ不同的每U服务提供一个独立的层,以下?J2EE 典型的四层结?
q行在客L机器上的客户层组?br /> q行在J2EE服务器上的Web层组?br /> q行在J2EE服务器上的业务逻辑层组?br /> q行在EIS服务器上的企业信息系l?Enterprise information system)层Y?br /> J2EE应用E序lg
J2EE应用E序是由lg构成?J2EElg是具有独立功能的软g单元Q它们通过相关的类
和文件组装成J2EE应用E序Qƈ与其他组件交互。J2EE说明书中定义了以下的J2EElg
:
应用客户端程序和applets是客户层lg.
Java Servlet和JavaServer Pages(JSP)是web层组?
Enterprise JavaBeans(EJB)是业务层lg.
客户层组?br /> J2EE应用E序可以是基于web方式?也可以是Z传统方式?
web 层组件J2EE web层组件可以是JSP 面或Servlets.按照J2EE规范Q静态的HTML面


和Applets不算是web层组件?br /> 正如下图所C的客户层那Pweb层可能包含某?JavaBean 对象来处理用戯入,q把
输入发送给q行在业务层上的enterprise bean 来进行处理?br /> 业务层组?br /> 业务层代码的逻辑用来满银行Q零售,金融{特D商务领域的需?p行在业务层上
的enterprise bean q行处理. 下图表明了一个enterprise bean 是如何从客户端程?br /> 接收数据Q进行处?如果必要的话), q发送到EIS 层储存的Q这个过E也可以逆向q?br /> 行?br /> 有三U企业的bean: 会话(session) beans, 实体(entity) beans, ?消息驱动(mes
sage-driven) beans. 会话bean 表示与客LE序的时交? 当客LE序执行完后
, 会话bean 和相x据就会消? 相反, 实体bean 表示数据库的表中一行永久的记录
. 当客LE序中止或服务器关闭? ׃有潜在的服务保证实体bean 的数据得以保?br /> .消息驱动 bean l合了会话bean ?JMS的消息监听器的特? 允许一个业务层lg?br /> 步接收JMS 消息.
企业信息pȝ?br /> 企业信息pȝ层处理企业信息系lY件包括企业基pȝ例如企业资源计划 (ERP)
, 大型Z务处? 数据库系l?和其它的遗留信息pȝ. 例如QJ2EE 应用lg可能?br /> 了数据库q接需要访问企业信息系l?br /> ? J2EE 的结?br /> q种ZlgQ具有^台无x的J2EE l构使得J2EE E序的编写十分简单,因ؓ业务
逻辑被封装成可复用的lgQƈ且J2EE 服务器以容器的Ş式ؓ所有的lgcd提供后台
服务. 因ؓ你不用自己开发这U服? 所以你可以集中_֊解决手头的业务问?


容器和服?br /> 容器讄定制了J2EE服务器所提供得内在支持,包括安全Q事务管理,JNDI(Java Nami
ng and Directory Interface)d,q程q接{服务,以下列出最重要的几U服务:
J2EE安全(Security)模型可以让你配置 web lg或enterprise bean ,q样只有被授?br /> 的用h能访问系l资? 每一客户属于一个特别的角色Q而每个角色只允许Ȁzȝ?br /> 的方法。你应在enterprise bean的布|描qC声明角色和可被激zȝҎ。由于这U声
明性的ҎQ你不必~写加强安全性的规则?br /> J2EE 事务理QTransaction ManagementQ模型让你指定组成一个事务中所有方法间?br /> 关系Q这样一个事务中的所有方法被当成一个单一的单? 当客LȀzM个enterpri
se bean中的ҎQ容器介入一理事务。因有容器管理事务,在enterprise bean中不
必对事务的边界进行编码。要求控制分布式事务的代码会非常复杂。你只需在布|描q?br /> 文g中声明enterprise bean的事务属性,而不用编写ƈ调试复杂的代码。容器将L?br /> 件ƈZ处理此enterprise bean的事务?br /> JNDI d(JNDI Lookup)服务向企业内的多重名字和目录服务提供了一个统一的接?q?br /> 样应用程序组件可以访问名字和目录服务.
J2EEq程q接QRemote Client ConnectivityQ模型管理客L和enterprise bean间的
低层交互. 当一个enterprise bean创徏? 一个客L可以调用它的Ҏp它和客户
端位于同一虚拟Z一?
生存周期理QLife Cycle ManagementQ模型管理enterprise bean的创建和U除,一?br /> enterprise bean在其生存周期中将会历l几U状态。容器创建enterprise beanQƈ?br /> 可用实例池与zd状态中Ud他,而最l将其从容器中移除。即使可以调用enterprise
bean的create及removeҎQ容器也会在后台执行这些Q务?br />

数据库连接池QDatabase Connection PoolingQ模型是一个有价值的资源。获取数据库
q接是一耗时的工作,而且q接数非常有限。容器通过理q接池来~和q些问题?br /> enterprise bean可从池中q速获取连接。在bean释放q接之可为其他bean使用?br /> 容器cd
J2EE应用lg可以安装部vC下几U容器中?
EJB 容器理所有J2EE 应用E序中企业bean 的执? enterprise bean 和它们的?br /> 器运行在J2EE 服务器上.
Web 容器理所有J2EE 应用E序中JSP面和Servletlg的执? Web lg和它们的?br /> 器运行在J2EE 服务器上.
应用E序客户端容器管理所有J2EE应用E序中应用程序客Llg的执? 应用E序?br /> L和它们的容器q行在J2EE 服务器上.
Applet 容器是运行在客户端机器上的web览器和 Java 插g的结?
? J2EE的核心API与组?br /> J2EEq_׃整套服务QServicesQ、应用程序接口(APIsQ和协议构成Q它对开发基
于Web的多层应用提供了功能支持Q下面对J2EE中的13U技术规范进行简单的描述(限于
幅Q这里只能进行简单的描述):
JDBC(Java Database Connectivity):
JDBC API问不同的数据库提供了一U统一的途径Q象ODBC一PJDBC对开发者屏?br /> 了一些细节问题,另外QJDCBҎ据库的访问也hq_无关性?br /> JNDI(Java Name and Directory Interface):
JNDI API被用于执行名字和目录服务。它提供了一致的模型来存取和操作企业U的资源
如DNS和LDAPQ本地文件系l,或应用服务器中的对象?br />

EJB(Enterprise JavaBean):
J2EE技术之所以赢得某体广泛重视的原因之一是EJB。它们提供了一个框架来开发和?br /> 施分布式商务逻辑Q由此很显著地简化了h可׾~性和高度复杂的企业应用的开?br /> 。EJB规范定义了EJBlg在何时如何与它们的容器进行交互作用。容器负责提供公用的
服务Q例如目录服务、事务管理、安全性、资源缓冲池以及定w性。但q里值得注意?br /> 是,EJBq不是实现J2EE的唯一途径。正是由于J2EE的开放性,使得有的厂商能够以一U?br /> 和EJBq的方式来辑ֈ同样的目的?br /> RMI(Remote Method Invoke):
正如其名字所表示的那PRMI协议调用q程对象上方法。它使用了序列化方式在客L
和服务器端传递数据。RMI是一U被EJB使用的更底层的协议?br /> Java IDL/CORBA:
在Java IDL的支持下Q开发h员可以将Java和CORBA集成在一赗?他们可以创徏Java?br /> 象ƈ使之可在CORBA ORB中展开, 或者他们还可以创徏Javacdƈ作ؓ和其它ORB一起展开
的CORBA对象的客戗后一U方法提供了另外一U途径Q通过它Java可以被用于将你的?br /> 的应用和旧的pȝ盔R成?br /> JSP(Java Server Pages):
JSP面由HTML代码和嵌入其中的Java代码所l成。服务器在页面被客户端所h以后?br /> q些Java代码q行处理Q然后将生成的HTML面q回l客L的浏览器?br /> Java Servlet:
Servlet是一U小型的JavaE序Q它扩展了Web服务器的功能。作ZU服务器端的应用
Q当被请求时开始执行,q和CGI Perl脚本很相伹{Servlet提供的功能大多与JSPcM
Q不q实现的方式不同。JSP通常是大多数HTML代码中嵌入少量的Java代码Q而servlets
全部由Java写成q且生成HTML?br /> XML(Extensible Markup Language):
XML是一U可以用来定义其它标记语a的语a。它被用来在不同的商务过E中׃n数据?br /> XML的发展和Java是相互独立的Q但是,它和Javah的相同目标正是^台独立性。通过
Java和XML的组合,您可以得C个完的hq_独立性的解决Ҏ?br /> JMS(Java Message Service):
MS是用于和面向消息的中间g怺通信的应用程序接?API)。它既支持点对点的域Q有
支持发布/订阅(publish/subscribe)cd的域Qƈ且提供对下列cd的支持:l认可的
消息传?事务型消息的传递,一致性消息和h持久性的订阅者支持。JMSq提供了?br /> 一U方式来Ҏ的应用与旧的后台pȝ盔R成?br /> JTA(Java Transaction Architecture):
JTA定义了一U标准的APIQ应用系l由此可以访问各U事务监控?br /> JTS(Java Transaction Service):
JTS是CORBA OTS事务监控的基本的实现。JTS规定了事务管理器的实现方式。该事务理
器是在高层支持Java Transaction API (JTA)规范Qƈ且在较底层实现OMG OTS specif
ication的Java映像。JTS事务理器ؓ应用服务器、资源管理器、独立的应用以及通信
资源理器提供了事务服务?br /> JavaMail:
JavaMail是用于存取邮件服务器的APIQ它提供了一套邮件服务器的抽象类。不仅支持S
MTP服务器,也支持IMAP服务器?br /> JTA(JavaBeans Activation Framework):
JavaMail利用JAF来处理MIME~码的邮仉件?


谭明 2007-10-11 21:33 发表评论
]]>
վ֩ģ壺 ѸƵ| Ļ| ߹ۿվ| ޾Ʒþþþþþþþþþ | av˾þۺɫ| 99re߾ƷƵ| ޾ƷAAAAƬAPP | ŷ޹Һ| 㽶þþƷ| 椸ѹۿƵ| aaaëƬѹۿ| þù޾Ʒ| պƷһ| ѿٶ޵վ| eeussӰԺֱ| sss߲| 輤һ| ëƬƵۿ| Ʒվ| ɫһ| ޴רӰԺ| һ㽶| վѹۿ| ޻ɫ߹ۿ| ߹ۿƵ| þˮAV뾫Ʒ| AV뾫Ʒ| AV뾫ƷһٶӰԺ| **ëƬֱ߲ | ۺۺͼ| ޾Ʒav| ɫ˿ѹۿվ| 91ȾþѾƷ99| aëƬͼƬ| ѿƸappһ»ɫ¼| ޹Ʒ߹ۿ| þþƷav鶹| ƷƵ߹ۿ| ޳AƬ| ҹӰѹۿ| þֻоƷ10|