??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品一区二区三区精品,青青草av免费在线观看,中文字幕欧美日本乱码一线二线http://www.aygfsteel.com/wxb1988/category/54785.html知h者智Q自知者明。胜有力,自胜者强?/description>zh-cnTue, 02 Jun 2015 08:09:54 GMTTue, 02 Jun 2015 08:09:54 GMT60设计模式http://www.aygfsteel.com/wxb1988/archive/2015/06/02/425453.htmlwxb1988wxb1988Tue, 02 Jun 2015 08:01:00 GMThttp://www.aygfsteel.com/wxb1988/archive/2015/06/02/425453.htmlhttp://www.aygfsteel.com/wxb1988/comments/425453.htmlhttp://www.aygfsteel.com/wxb1988/archive/2015/06/02/425453.html#Feedback0http://www.aygfsteel.com/wxb1988/comments/commentRss/425453.htmlhttp://www.aygfsteel.com/wxb1988/services/trackbacks/425453.html阅读全文

wxb1988 2015-06-02 16:01 发表评论
]]>
UML概述与详?/title><link>http://www.aygfsteel.com/wxb1988/archive/2015/06/02/425452.html</link><dc:creator>wxb1988</dc:creator><author>wxb1988</author><pubDate>Tue, 02 Jun 2015 08:00:00 GMT</pubDate><guid>http://www.aygfsteel.com/wxb1988/archive/2015/06/02/425452.html</guid><wfw:comment>http://www.aygfsteel.com/wxb1988/comments/425452.html</wfw:comment><comments>http://www.aygfsteel.com/wxb1988/archive/2015/06/02/425452.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wxb1988/comments/commentRss/425452.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wxb1988/services/trackbacks/425452.html</trackback:ping><description><![CDATA[<div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><strong><span style="color: blue;">l一建模语言(UML:Unified Modeling Language)</span></strong></div><div style="font-family: Arial; line-height: 26px; margin-left: 18pt; text-indent: -18pt; background-color: #ffffff;"><strong><span style="color: blue;">1Q?/span></strong><strong><span style="color: blue;">能够从不同的角度来看待系l的l构Q行为,功能Q需求)?/span></strong></div><div style="font-family: Arial; line-height: 26px; margin-left: 18pt; text-indent: -18pt; background-color: #ffffff;"><strong><span style="color: blue;">2Q?/span></strong><strong><span style="color: blue;">能够在不同抽象程度上考虑pȝQ而仅仅是源代码是不够的。源代码是非常细化的内部l构Q不能用来徏造复杂的pȝ?/span></strong></div><table cellspacing="0" cellpadding="0" width="100%" border="0" style="color: #000000; font-family: Arial; font-size: 14px; line-height: 26px; width: 946px; border-collapse: collapse; background-color: #ffffff;"><tbody><tr style="height: 13.75pt;"><td valign="top" width="100%" colspan="2" style="border-width: medium medium 1pt; border-style: none none solid; padding: 0cm 5.4pt; width: 931.625px; border-bottom-color: windowtext; height: 13.75pt;">UML囑֏其目?/td></tr><tr style="height: 13.3pt;"><td valign="top" width="18%" style="border: medium none; padding: 0cm 5.4pt; width: 160.625px; height: 13.3pt;">当你……</td><td valign="top" width="81%" style="border: medium none; padding: 0cm 5.4pt; width: 756.625px; height: 13.3pt;">使用UML?#8230;…</td></tr><tr style="height: 13.3pt;"><td valign="top" width="18%" rowspan="2" style="padding: 0cm 5.4pt; width: 160.625px; height: 13.3pt;">在分析阶D?/td><td valign="top" width="81%" style="padding: 0cm 5.4pt; width: 756.625px; height: 13.3pt;">用例图,它们包含和系l交互的实体以及需要实现的功能炏V?/td></tr><tr style="height: 10.1pt;"><td valign="top" width="81%" style="padding: 0cm 5.4pt; width: 756.625px; height: 10.1pt;">zd图,它们焦炚w中于问题域(Z以及其它M工作的实际空_E序的主题域Q的工作而不是程序的逻辑?/td></tr><tr style="height: 10.1pt;"><td valign="top" width="18%" style="padding: 0cm 5.4pt; width: 160.625px; height: 10.1pt;">观察对象交互</td><td valign="top" width="81%" style="padding: 0cm 5.4pt; width: 756.625px; height: 10.1pt;">交互图,它们展示特定的对象彼如何此交互。由于它们处理特定案例而不是一般情况,因此它们在检验需求和验设计时都能有所帮助。最行的交互图是顺序图?/td></tr><tr style="height: 17.9pt;"><td valign="top" width="18%" style="padding: 0cm 5.4pt; width: 160.625px; height: 17.9pt;">在设计阶D?/td><td valign="top" width="81%" style="padding: 0cm 5.4pt; width: 756.625px; height: 17.9pt;">cdQ它们详q类与类之间的关pR?/td></tr><tr style="height: 10.1pt;"><td valign="top" width="18%" style="padding: 0cm 5.4pt; width: 160.625px; height: 10.1pt;">观察对象的行为,q些行ؓ因对象所处的状态而不?/td><td valign="top" width="81%" style="padding: 0cm 5.4pt; width: 756.625px; height: 10.1pt;">状态图Q它们详qC个对象可能处于的不同状态以及这些状态之间的q渡?/td></tr><tr style="height: 4pt;"><td valign="top" width="18%" style="padding: 0cm 5.4pt; width: 160.625px; height: 4pt;">在布|阶D?/td><td valign="top" width="81%" style="padding: 0cm 5.4pt; width: 756.625px; height: 4pt;">布v图,它们展示了不同的模块被如何部v。我不会在此讨论它们?/td></tr></tbody></table><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"> </div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">UML</span><span style="color: blue;">的定义包括UML语义和UML表示法两个部分:</span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">UML语义 描述ZUML的精元模型定义。元模型为UML的所有元素在语法和语义上提供了简单、一致、通用的定义性说?使开发者能在语义上取得一?消除了因异的最佌达方法所造成的媄响。此外UMLq支持对元模型的扩展定义?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">UML表示法 定义UMLW号的表C法,为开发者或开发工具用这些图形符号和文本语法为系l徏模提供了标准。这些图形符号和文字所表达的是应用U的模型,在语义上它是UML元模型的实例?br />标准建模语言UML的重要内容可以由下列五类??U图?来定?</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">·W一cL<span style="color: blue;">用例?从用戯度描q系l功?q指出各功能的操作者?br />·W二cL静态图(Static diagram),包括cd、对象图和包图。其中类图描q系l中cȝ静态结构。不仅定义系l中的类,表示cM间的联系如关联、依赖、聚合等,也包括类的内部结?cȝ属性和操作)。类图描q的是一U静态关p?在系l的整个生命周期都是有效的。对象图是类囄实例,几乎使用与类囑֮全相同的标识。他们的不同点在于对象图昄cȝ多个对象实例,而不是实际的cR一个对象图是类囄一个实例。由于对象存在生命周?因此对象囑֏能在pȝ某一旉D存在。包由包或类l成,表示包与包之间的关系。包囄于描q系l的分层l构?br />·W三cL行ؓ?Behavior diagram),描述pȝ的动态模型和l成对象间的交互关系。其中状态图描述cȝ对象所有可能的状态以及事件发生时状态的转移条g。通常,状态图是对cd的补充。在实用上ƈ不需要ؓ所有的cȝ状态图,仅ؓ那些有多个状态其行ؓ受外界环境的影响q且发生改变的类ȝ态图。而活动图描述满用例要求所要进行的zd以及zd间的U束关系,有利于识别ƈ行活动?br />·W四cL交互?Interactive diagram),描述对象间的交互关系。其中顺序图昄对象之间的动态合作关p?它强调对象之间消息发送的序,同时昄对象之间的交?合作图描q对象间的协作关p?合作图跟序囄?昄对象间的动态合作关pR除昄信息交换?合作图还昄对象以及它们之间的关pR如果强调时间和序,则用顺序图;如果上下U关p?则选择合作图。这两种囑֐UCؓ交互图?br />·W五cL实现? Implementation diagram )。其中构件图描述代码部g的物理结构及各部件之间的依赖关系。一个部件可能是一个资源代码部件、一个二q制部g或一个可执行部g。它包含逻辑cL实现cȝ有关信息。部件图有助于分析和理解部g之间的相互媄响程度?br />配置囑֮义系l中软硬件的物理体系l构。它可以昄实际的计机和设?用节点表C?以及它们之间的连接关p?也可昄q接的类型及部g之间的依赖性。在节点内部,攄可执行部件和对象以显C点跟可执行Y件单元的对应关系?/span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/7d9f8fa3bf3e4ebbb9bd4dca716219c4.png" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">从应用的角度?当采用面向对象技术设计系l时,首先是描q需?其次Ҏ需求徏立系l的静态模?以构造系l的l构;W三步是描述pȝ的行为。其中在W一步与W二步中所建立的模型都是静态的,包括用例图、类?包含?、对象图、组件图和配|图{五个图?是标准徏模语aUML的静态徏模机制。其中第三步中所建立的模型或者可以执?或者表C执行时的时序状态或交互关系。它包括状态图、活动图、顺序图和合作图{四个图?是标准徏模语aUML的动态徏模机制。因?标准建模语言UML的主要内容也可以归纳为静态徏模机制和动态徏模机制两大类?/span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">静态视图:</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">cd</span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/efedc2fd8506421b980a86304a603e67.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">关系的种c?/span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/4fd612f5e18344758381f4642b2ddf67.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">用例之间的关p?/span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/c3e3848eee1742a78166c7c4181e3014.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">状态的U类</span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/654726e0c53a4c19aef42e82037f43a7.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">ȝQ?/span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">行ؓQ事物随着旉q行的改变。状态图和活动图描述个别cd的行为。例如,用例Q类Q子pȝQ组Ӟ序图描qCl类型的协作Q我们用协作图。许多类潜在的结构,来定义对象的协作Q这些协作实现用例,或完成一个用例。协作是一l对象实C个用例。状态图是对象的行ؓ描述?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"> </div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">售票pȝ设计Q大家熟悉)Q?/span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">用例视图</span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/9a1427d48e6641d1adb5d28fa141aa93.png" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"> </div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">序?/span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/557edda05a224a4f995b33ffe3d84526.png" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">协作?/span><br />   <img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/b738097a53d44de2b3e9ae2048ab69d3.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">状态机视图</span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/f6c7e0e621ba44079d692b5ab69c6b92.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">zd视图</span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/788d081089cf4782a3c4bcf051342ae9.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">物理视图</span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">构g?/span><br />  </div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/f3d4f9ee94954610b84dfe5e842422a6.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">部v图(描述层)<br />  </span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/c6b411ba79a14922aaf27228780f982a.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">实例层部|图</span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/dbda0d9b388546209fdd9ecda13ceaeb.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">模型理视图</span></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/33220638ac254960a9b4571046b7569a.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"> </div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><strong><span style="color: blue;">全面认识UMLcd元素</span></strong> Q?a target="_blank" style="color: #ca0000; text-decoration: none;">http://blog.csdn.net/legendinfo/</a>Q?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">c(ClassQ?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">c(图AQ是对象的蓝图,其中包含3个组成部分。第一个是Java中定义的cd。第二个是属性(attributesQ。第三个是该cL供的Ҏ?br />属性和操作之前可附加一个可见性修饰符。加P+Q表C具有公共可见性。减P-Q表C私有可见性?可C受保护的可见性。省略这些修饰符表示hpackageQ包Q别的可见性。如果属性或操作h下划U,表明它是静态的。在操作中,可同时列出它接受的参敎ͼ以及q回cdQ如图A?#8220;Java”区域所C?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">图A</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/7828c73331ea4151a73ab230eb403667.gif" style="border: none; max-width: 100%;" /><br />包(PackageQ?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">包(图BQ是一U常规用途的l合机制。UML中的一个包直接对应于Java中的一个包。在Java中,一个包可能含有其他包、类或者同时含有这两者。进行徏模时Q你通常拥有逻辑性的包,它主要用于对你的模型q行l织。你q会拥有物理性的包,它直接{换成pȝ中的Java包。每个包的名U对q个包进行了惟一性的标识?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">图B</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/4c8f8d9aabdb4dca9a277f854fbc1f58.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">接口QInterfaceQ?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">接口Q图CQ是一pd操作的集合,它指定了一个类所提供的服务。它直接对应于Java中的一个接口类型。接口既可用图C的那个图标来表示Q也可由附加?lt;<interface>>的一个标准类来表C。通常Q根据接口在cd上的样子Q就能知道与其他cȝ关系?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">图C</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/b36f9eadfd584f1dba74caa5219538b8.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">关系</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">后面的例子将针对某个具体目的来独立地展示各种关系。虽然语法无误,但这些例子可q一步精|在它们的有效范围内包括更多的语义?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">依赖QDependencyQ?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">实体之间一?#8220;使用”关系暗示一个实体的规范发生变化后,可能影响依赖于它的其他实例(图DQ。更具体地说Q它可{换ؓ对不在实例作用域内的一个类或对象的Mcd的引用。其中包括一个局部变量,寚w过Ҏ调用而获得的一个对象的引用Q如下例所C)Q或者对一个类的静态方法的引用Q同时不存在那个cȝ一个实例)。也可利?#8220;依赖”来表C包和包之间的关pR由于包中含有类Q所以你可根据那些包中的各个cM间的关系Q表C出包和包的关系?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">图D</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/0f993949fff745999deb605d554590d2.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">兌QAssociationQ?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">实体之间的一个结构化关系表明对象是相互连接的。箭头是可选的Q它用于指定D能力。如果没有箭_暗示是一U双向的D能力。在Java中,兌Q图EQ{换ؓ一个实例作用域的变量,像图E?#8220;Java”区域所展示的代码那栗可Z个关联附加其他修饰符。多重性(MultiplicityQ修饰符暗示着实例之间的关pR在C代码中,Employee可以?个或更多的TimeCard对象。但是,每个TimeCard只从属于单独一个Employee?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">图E</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/b770e146db704c8f85b53ef20d225598.gif" style="border: none; max-width: 100%;" /><br />聚合QAggregationQ?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">聚合Q图FQ是兌的一UŞ式,代表两个cM间的整体/局部关pR聚合暗C着整体在概念上处于比局部更高的一个别,而关联暗CZ个类在概念上位于相同的别。聚合也转换成Java中的一个实例作用域变量?br />兌和聚合的区别Ua是概念上的,而且严格反映在语义上。聚合还暗示着实例图中不存在回路。换a之,只能是一U单向关pR?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">图F</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/2825005037b84abe896b4f515186a34f.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">合成QCompositionQ?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">合成 Q图GQ是聚合的一U特DŞ式,暗示“局?#8221;?#8220;整体”内部的生存期职责。合成也是非׃n的。所以,虽然局部不一定要随整体的销毁而被销毁,但整体要么负责保持局部的存活状态,要么负责其销毁。局部不可与其他整体׃n。但是,整体可将所有权转交l另一个对象,后者随卛_承担生存期职责?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">Employee和TimeCard的关pL许更适合表示?#8220;合成”Q而不是表C成“兌”?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">图G</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/f3bf19a91a604a15a360782dc984408b.gif" style="border: none; max-width: 100%;" /><br />泛化QGeneralizationQ?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">泛化Q图HQ表CZ个更泛化的元素和一个更具体的元素之间的关系。泛化是用于对承进行徏模的UML元素。在Java中,用extends关键字来直接表示q种关系?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">图H</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/a79bfb22d8fe42989072b84291a9316e.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">实现QRealizationQ?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">实例Q图IQ关pL定两个实体之间的一个合同。换a之,一个实体定义一个合同,而另一个实体保证行该合同。对Java应用E序q行建模Ӟ实现关系可直接用implements关键字来表示?/div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;">图I</div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/843685e31db84719887e5ee2e1b1dfc1.gif" style="border: none; max-width: 100%;" /></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"> </div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><strong><span style="color: blue;">术语大全</span></strong></div><div style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="color: blue;">access</span><span style="color: blue;">Q访问)</span><br />讉K是一U许可依赖关p,允许一个包引用另一个包中的元素?br />见friend、import、visibility?br />语义<br />一个包Q客P如果要引用另一个包Q提供者)内的元素Q那么它必须引入一个包Q该包包括客户包到提供者包的《access》或《import》依赖关pM的元素。一个包可以隐含地获得对由包含该包的M包所引入的包的访问权Q即Q嵌套包可以看到包含包可以看到的一切)?br />包中的元素可以访问包内所有可见的元素。可见性规则可以ȝ如下Q?br />* 一个包中定义的元素在同一个包中是可见的?br />* 如果一个元素在一个包中是可见的,那么它对所有嵌套在q个包中的所有包都是可见的?br />* 如果一个包讉K或引入另一个包Q那么在要被引入或访问的包中定义为公共可见性的元素对引入包都是可见的?br />* 如果一个包是另一个包的孩子,那么所有在父包中定义ؓ公共的或受保护的可见性的元素对子包是可见的?br />* 讉K或引入依赖关pL不能传递的Q如果A能看到BQ且B能看到CQ这q不意味着A能看到C?br />l论Q除非一个包能够讉K它的嵌套包且嵌套包的内容是公共可见的Q否则这个包不能看到它自q嵌套包的内部?br />下面是有兛_见性的更深一步的规则Q?br />* 如果一个类元的内容Q如它的属性和操作以及嵌套c,在类元中h公共可见性,那么它们在包中是可见的。请注意一个子pȝ的未l织的内Ҏ׃面提到的包规则指导的Q但是Q何子pȝ本n的属性或操作p条规则指对{?br />* 如果一个类元的内容有公q或受保护的可见性,那么它们对后代类元是可见的?br />* 一个类元的所有内容对cd内的元素都是可见的,包括cd的方法或状态机中的元素?br />一般情况下都会涉及到对{包中的元素。在q种情况下,一个元素能看到它自己包内的所有元素和被它所在包引入的包的具有公共可见性的所有元素。一个类可以看到其他cM的公q征。一个类也可以看到它的祖先的受保护的特征?br />表示?br />讉K依赖关系用一个从客户包指向提供者包的虚头表示。箭头用关键字《access》作为标受?br />讨论<br />图ؓ一个两个包间的对等层访问的例子。包P能够讉K包QQ但是包Q不能讉K包P。P包中的类K和L能看到包Q中的cMQ但是它们看不到U有cN。除了具有公共可见性的cK之外Q类M和N看不到包P中的Mc,因ؓ包Q不能讉K包P。要想一个类对对{包是可见的Q这个类必须h公共可见性,q且它的包必被对等包访问或引入?br /><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/ed7d47fe849e41308077b28f1abd4267.gif" style="border: none; max-width: 100%;" /><br />囑֯{访?br /><img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/longronglin/96cccb5e8e70422a9cd22161d482e530.gif" style="border: none; max-width: 100%;" /><br />图访问规?br />图ؓ一个有兛_见性和讉K声明的更复杂的例子。元素名字前的符号代表了它的可见性:+代表公共的,#代表是受保护的(只对后代可见Q,-代表是私有的Q对外界是不可见的)?br />cA能看到C和E因ؓ它们包含在包Y和X内?br />cC和A能够看到DQ因为包Y引入了包Z。类A嵌套在包Y中ƈ且能够看到Y能看到的一切?br />cA、C和E能看到BQ因为它们嵌套在包X中,而X引入包含B的包VQ但是,它们看不到FQ因为F在它的包V中是有私有可见性。所以,cF在包V外是看不到的?br />cE看不到D因ؓD在包Z中,而Zq没有被包X讉K?br />cC和E都看不到A。类A在包U中,U没有被Q何包讉K?br />cB和F能够看到cD和EQD和E建立在包含包中。它们也能看到CQC在包Y中,而包Y被包含包讉K。虽然F是私有的Q但qƈ不媄响它看到其他的类Q而其他的cȝ不到F?br />cB和F能够互相看到Q因为它们在同一个包中。类F对外面的包中的类是私有的Q但对它自己包中的类不是q样?/div><img src ="http://www.aygfsteel.com/wxb1988/aggbug/425452.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wxb1988/" target="_blank">wxb1988</a> 2015-06-02 16:00 <a href="http://www.aygfsteel.com/wxb1988/archive/2015/06/02/425452.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>