+
来自「关于面向构件的软件体系的文档资料 从思想开始更新开发模式」· 代码 · 共 1,459 行 · 第 1/5 页
TXT
1,459 行
333'>Component
Interface</span><span style=3D'mso-bidi-font-size:10.5pt;line-height:150%;
font-family:SimSun;mso-ascii-font-family:"Times New Roman";mso-hansi-font-f=
amily:
"Times New Roman";color:#333333'>)和构件(</=
span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'>Component</span><span
style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>)分开,是面向=
500;件方法论的基本要求=
;,是不同构件(包括&#=
19981;同厂商的构件)可Ā=
45;配(</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'>Match</span><span
style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>)、可替换(</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'>Swap</span><span
style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>)、可混合使用A=
288;</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'>Mix</span><span
style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>)的基础。</span><span lang=3D=
EN-US
style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333333'><o:p></o=
:p></span></p>
<p class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><span lang=
=3DEN-US><!--[if gte vml 1]><v:shape
id=3D"_x0000_i1029" type=3D"#_x0000_t75" style=3D'width:292.5pt;height:164=
.25pt'
o:ole=3D"">
<v:imagedata src=3D"file9595.files/image002.wmz" o:title=3D""/>
</v:shape><![endif]--><![if !vml]><img width=3D390 height=3D219
src=3D"file9595.files/image003.gif" v:shapes=3D"_x0000_i1029"><![endif]><!-=
-[if gte mso 9]><xml>
<o:OLEObject Type=3D"Embed" ProgID=3D"Visio.Drawing.6" ShapeID=3D"_x0000_i=
1029"
DrawAspect=3D"Content" ObjectID=3D"_1204355005">
</o:OLEObject>
</xml><![endif]--></span></p>
<p class=3DMsoNormal align=3Dcenter style=3D'mso-margin-top-alt:auto;mso-ma=
rgin-bottom-alt:
auto;text-align:center;line-height:150%'><span style=3D'font-family:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man"'>图</span><span
lang=3DEN-US>3.2 </span><span style=3D'font-family:SimSun;mso-ascii-font-fa=
mily:
"Times New Roman";mso-hansi-font-family:"Times New Roman"'>构件=
接口</span></p>
<p class=3DMsoBodyTextFirstIndent style=3D'mso-char-indent-count:2.0;line-h=
eight:
150%'><span lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150=
%;
color:#333333'><span style=3D'mso-tab-count:1'> &nbs=
p; </span></span><span
style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>任何构件,必须=
454;现一到多个构件接口=
;。反过来,构件接口&#=
21487;以由多个构件实现z=
90;另外,也存在尚未被=
实现的构件接口,这=
3545;面向构件方法论是ও=
7;有的。</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'><o:p></o:p></span></p>
<p class=3DMsoBodyTextFirstIndent style=3D'mso-char-indent-count:2.0;line-h=
eight:
150%'><span style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family=
:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>构件接口是外部#=
775;问构件的访问点。由=
;于构件是对构件接口&#=
30340;实现(</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'>Implement</span><span
style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>),从逻辑上看A=
292;构件的一些操作和数=
;据也是可外部访问的&#=
65307;但是,构件中可以ê=
50;义构件接口中没有的=
数据和操作,它们是=
9981;可见的。</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'><o:p></o:p></span></p>
<p class=3DMsoNormal align=3Dcenter style=3D'text-align:center;text-indent:=
21.0pt;
mso-char-indent-count:2.0'><span lang=3DEN-US><!--[if gte vml 1]><v:shape i=
d=3D"_x0000_i1026"
type=3D"#_x0000_t75" style=3D'width:138pt;height:222.75pt' o:ole=3D"">
<v:imagedata src=3D"file9595.files/image004.wmz" o:title=3D""/>
</v:shape><![endif]--><![if !vml]><img width=3D184 height=3D297
src=3D"file9595.files/image005.gif" v:shapes=3D"_x0000_i1026"><![endif]><!-=
-[if gte mso 9]><xml>
<o:OLEObject Type=3D"Embed" ProgID=3D"Visio.Drawing.6" ShapeID=3D"_x0000_i=
1026"
DrawAspect=3D"Content" ObjectID=3D"_1204355006">
</o:OLEObject>
</xml><![endif]--></span></p>
<p class=3DMsoBodyTextFirstIndent align=3Dcenter style=3D'text-align:center;
mso-char-indent-count:2.0;line-height:150%'><span style=3D'mso-bidi-font-si=
ze:
10.5pt;line-height:150%;font-family:SimSun;mso-ascii-font-family:"Times New=
Roman";
mso-hansi-font-family:"Times New Roman";color:#333333'>图</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'>3.3
</span><span style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-famil=
y:
SimSun;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times=
New Roman";
color:#333333'>构件与构件接口=
034;例</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'><o:p></o:p></span></p>
<p class=3DMsoBodyTextFirstIndent style=3D'mso-char-indent-count:2.0;line-h=
eight:
150%'><span style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family=
:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>不同构件(包括=
981;同厂商的构件)之间=
;可以相互协作,这种&#=
21327;作是通过构件接口ʌ=
88;</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'>Component
Interface</span><span style=3D'mso-bidi-font-size:10.5pt;line-height:150%;
font-family:SimSun;mso-ascii-font-family:"Times New Roman";mso-hansi-font-f=
amily:
"Times New Roman";color:#333333'>)进行的。&#=
22522;于构件接口在协作ß=
30;景中所处的地位不同=
,构件接口可能担任=
220;提供接口(</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'>Provided
Interface</span><span style=3D'mso-bidi-font-size:10.5pt;line-height:150%;
font-family:SimSun;mso-ascii-font-family:"Times New Roman";mso-hansi-font-f=
amily:
"Times New Roman";color:#333333'>)”或“依$=
182;接口(</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'>Required
Interface</span><span style=3D'mso-bidi-font-size:10.5pt;line-height:150%;
font-family:SimSun;mso-ascii-font-family:"Times New Roman";mso-hansi-font-f=
amily:
"Times New Roman";color:#333333'>)”的职责=
2290;</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'><o:p></o:p></span></p>
<p class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><span lang=
=3DEN-US
style=3D'mso-font-kerning:0pt'><!--[if gte vml 1]><v:shape id=3D"_x0000_i10=
27"
type=3D"#_x0000_t75" style=3D'width:387.75pt;height:192.75pt'>
<v:imagedata src=3D"file9595.files/image006.png" o:title=3D""/>
</v:shape><![endif]--><![if !vml]><img width=3D517 height=3D257
src=3D"file9595.files/image007.jpg" v:shapes=3D"_x0000_i1027"><![endif]><o:=
p></o:p></span></p>
<p class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><b><span la=
ng=3DEN-US><!--[if gte vml 1]><v:shape
id=3D"_x0000_i1028" type=3D"#_x0000_t75" style=3D'width:414.75pt;height:16=
9.5pt'>
<v:imagedata src=3D"file9595.files/image008.png" o:title=3D""/>
</v:shape><![endif]--><![if !vml]><img width=3D553 height=3D226
src=3D"file9595.files/image009.jpg" v:shapes=3D"_x0000_i1028"><![endif]><o:=
p></o:p></span></b></p>
<p class=3DMsoBodyTextFirstIndent align=3Dcenter style=3D'text-align:center;
mso-char-indent-count:2.0;line-height:150%'><span style=3D'mso-bidi-font-si=
ze:
10.5pt;line-height:150%;font-family:SimSun;mso-ascii-font-family:"Times New=
Roman";
mso-hansi-font-family:"Times New Roman";color:#333333'>图</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'>3.4
</span><span style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-famil=
y:
SimSun;mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times=
New Roman";
color:#333333'>构件接口</span><span lang=3DEN-US
style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333333'>UML<o:p>=
</o:p></span></p>
<p class=3DMsoBodyTextFirstIndent style=3D'text-indent:21.1pt;mso-char-inde=
nt-count:
2.0;line-height:150%'><b style=3D'mso-bidi-font-weight:normal'><span
style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>关注接口的设计</sp=
an></b><b
style=3D'mso-bidi-font-weight:normal'><span lang=3DEN-US style=3D'mso-bidi-=
font-size:
10.5pt;line-height:150%;color:#333333'><o:p></o:p></span></b></p>
<p class=3DMsoBodyTextFirstIndent style=3D'mso-char-indent-count:2.0;line-h=
eight:
150%'><span style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family=
:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>接口是构件描述=
427;们行为的机制,并且=
;提供了对它们的服务&#=
30340;访问。由于实现是ê=
36;全隐蔽的,接口描述=
就成为构件的潜在客=
5143;方能够依赖的所有߼=
9;息。这使得接口描述&=
#30340;表达力和完整性在=
219;何基于构件的软件方=
;法中都是一个主要考&#=
34385;的问题。</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'><o:p></o:p></span></p>
<p class=3DMsoBodyTextFirstIndent style=3D'mso-char-indent-count:2.0;line-h=
eight:
150%'><span style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family=
:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>此外,在分析和#=
774;计的早期阶段,人们=
;致力于理解领域中的&#=
35282;色和责任,它是最ń=
56;系统接口的基础。这=
引出了一种新的设计=
6041;法:基于接口的设෶=
5;。把接口作为关键的&=
#35774;计抽象引出了更加=
789;活的设计。它鼓励设=
;计者更抽象地考虑系&#=
32479;行为、定义独立的ć=
81;务提供者、描述服务=
间的协作,并且在解=
0915;熟悉的问题时复用६=
0;用的设计模式。这导&=
#33268;可以更加自然的系 =
479;设计,更加独立于实=
;现时所做的选择。</span><sp=
an
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'><o:p></o:p></span></p>
<p class=3DMsoBodyTextFirstIndent style=3D'mso-char-indent-count:2.0;line-h=
eight:
150%'><span style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family=
:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>这样的设计思想=
102;</span><span
lang=3DEN-US style=3D'mso-bidi-font-size:10.5pt;line-height:150%;color:#333=
333'>Internet</span><span
style=3D'mso-bidi-font-size:10.5pt;line-height:150%;font-family:SimSun;
mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Ro=
man";
color:#333333'>时代新应用程序=
379;应方法的一个重要部=
;分。为加速演化分布&#=
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?