⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 6patterns.html

📁 together是不比Rose差的设计工具,甚至在生成java类方面效果更好,该教材是together6.1的一份实例教程,不错!
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<html>

	<head>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
		<title>Together Tutorial -- Part 6</title>
		
		<link href="tutor.css" rel="styleSheet" type="text/css">
	</head>
	
	<body bgcolor="white" link="#003399" alink="#999999" vlink="#000066">
		<div align="center">
			<p class="head2" align="left"><span style="font-size: 9pt"><a href="mailto:%20e.w@263.net">&#32763;&#35793;: &#26446;&#39062;(e.w@263.net)</a></span></p>
		</div>
		<div align="center">
			<p class="head2"><a name="top"></a>Together &#25945;&#31243;<br>
 6: &#27169;&#26495;&#27169;&#24335;</p>
		</div>
        <p>&#27169;&#24335;&#26159;&#20195;&#30721;&#37325;&#29992;&#30340;&#19968;&#31181;&#26377;&#25928;&#24037;&#20855;. Together
        &#25903;&#25345;&#20004;&#31181;&#27169;&#24335;:
        &#27169;&#26495;&#27169;&#24335;&#21644; &quot;&#27169;&#22359;&quot;
        &#27169;&#24335;.
        &#27169;&#26495;&#27169;&#24335;&#23545;&#20110;&#21333;&#20010;&#31867;&#20197;&#21450;&#36830;&#25509;&#21644;&#23646;&#24615;&#24456;&#26377;&#29992;&#22788;.
        &#27169;&#22359;&#27169;&#24335;&#19968;&#33324;&#29992;&#20110;&#26356;&#22797;&#26434;&#30340;&#35774;&#35745;&#27169;&#24335;,
        &#22914; GoF &#35774;&#35745;&#27169;&#24335;&#25110; Coad
        &#31867;&#27169;&#24335;.
        &#20320;&#21487;&#20197;&#20351;&#29992;&#27169;&#24335;&#26469;&#21019;&#24314;&#26032;&#30340;&#31867;&#25110;&#25104;&#21592;.
        &#20320;&#20063;&#21487;&#20197;&#23558;&#27169;&#24335;&#24212;&#29992;&#21040;&#24050;&#23384;&#22312;&#30340;&#31867;&#21644;&#25104;&#21592;&#20013;.</p>
        <p>&#36825;&#19968;&#35838;&#20027;&#35201;&#38598;&#20013;&#35752;&#35770;&#27169;&#26495;&#27169;&#24335;.
        &#22312;&#26368;&#21518;,
        &#25105;&#20204;&#23558;&#28436;&#31034;&#22914;&#20309;&#21019;&#24314;&#20320;&#33258;&#24049;&#30340;&#31867;&#27169;&#26495;&#27169;&#24335;.</p>
        <p><b>&#30446;&#24405;:</b></p>
		<ul>
			<li><a class="onPage" href="#member">&#36873;&#25321;&#31867;&#25104;&#21592;&#27169;&#24335;</a>
			<li><a class="onPage" href="#link">&#23558;&#27169;&#24335;&#24212;&#29992;&#21040;&#36830;&#25509;</a>
			<li><a class="onPage" href="#templates">&#24212;&#29992;&#31867;&#27169;&#26495;&#27169;&#24335;</a>
			<li><a class="onPage" href="#GoF">&#21046;&#20316;&#33258;&#24049;&#30340;&#27169;&#26495;&#27169;&#24335;</a>
			<li><a class="onPage" href="#tip">&#25216;&#24039;</a>
		</ul>
		<p></p>
		<p><img height="2" width="900" src="images/generic/rainbow2.gif" alt="Divider line"></p>
        <p class="head3"><a name="member"></a>&#36873;&#25321;&#31867;&#25104;&#21592;&#27169;&#24335;</p>
        <p>Together
        &#25552;&#20379;&#20102;&#19977;&#31181;&#26222;&#36890;&#30340; Java
        &#31867;&#25104;&#21592;&#27169;&#24335;: &quot;Stub Implementations&quot;,
        &quot;Properties&quot;, &#20197;&#21450; &quot;Main method&quot;. &quot;Stub Implementations&quot;
        &#27169;&#24335;&#22312;&#19968;&#20010;&#38656;&#35201;&#36820;&#22238;&#20540;&#30340;&#25805;&#20316;&#20013;&#25554;&#20837;&#34394;&#26500;&#30340;
        &quot;return&quot; &#35821;&#21477;. &quot;Properties&quot;
        &#27169;&#24335;&#21019;&#24314;&#24102; getter &#21644; setter
        &#25805;&#20316;&#30340;&#29305;&#24615;. &quot;Main method&quot;
        &#27169;&#24335;&#23558;&#19968;&#20010;&#25805;&#20316;&#25913;&#20026;
        main( ) &#26041;&#27861;.</p>
		<table border="0" cellpadding="0" cellspacing="2" bgcolor="#993300" width="100%">
			<tr>
				<td bgcolor="#993300">
					<table border="0" cellpadding="0" cellspacing="2" bgcolor="#ffffcc" width="100%">
						<tr>
							<td bgcolor="#ffffcc"><b>&#25805;&#20316;&#27493;&#39588;</b><b>:</b> 
                              &#23558; &quot;Stub Implementation&quot;
                              &#27169;&#24335;&#24212;&#29992;&#21040;&#19977;&#20010;&#26041;&#27861;: 
								<ol>
									<li><b>Coach.calcPrice()</b>
									<li><b>Reservation.ticketPurchased()</b>
									<li><b>Flight.numberOfTickets()</b>
								</ol>
                              <p>&#21024;&#38500; <b>FirstClass.calcPrice()</b>,
                              &#22240;&#20026;&#23427;&#26377;&#19968;&#20010;&#31354;&#30340;&#26041;&#27861;&#20307;,
                              &#28982;&#21518;&#23558; <b>calcPrice()</b> 
                              &#26041;&#27861;&#20174; <b>Coach</b>
                              &#22797;&#21046;&#21040; <b>FirstClass</b>. (&#19981;&#35201;&#20462;&#25913; <b>Reservation.calcPrice()</b>.
                              &#23558;&#36825;&#20010;&#26041;&#27861;&#20445;&#30041;&#21040;&#20197;&#21518;&#23454;&#29616;.)</p>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<p></p>
		<table border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
			<tr>
				<td bgcolor="#CCCCCC">
					<table border="0" cellpadding="5" cellspacing="2">
						<tr>
							<td valign="top" bgcolor="white">
                                <p>&#35201;&#24212;&#29992; &quot;stub&quot;
                                &#27169;&#24335;,
                                &#39318;&#20808;&#20174;&#25805;&#20316;&#30340;&#21491;&#38190;&#33756;&#21333;&#36873;&#25321; <b>Choose Pattern</b>. Together
                                &#25171;&#24320;&#19968;&#20010;&#27169;&#24335;&#31383;&#21475;,
                                &#20854;&#20013;&#21015;&#20986;&#20102;&#25104;&#21592;&#27169;&#24335;&#21644;&#36830;&#25509;&#27169;&#24335;. </p>
								<p>&#32534;&#36753;&#22120;&#26174;&#31034;&#32467;&#26524;&#20195;&#30721;.</p>
								<p><img src="images/airline/pro6_stubimplementioncode.png" width="351" height="136" border="0"></p>
							</td>
							<td valign="top" bgcolor="white"><img src="images/airline/pro6_memberpattern.png" width="341" height="297" border="0"></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<p></p>
		<p></p>
		<table border="0" cellpadding="0" cellspacing="2" bgcolor="#993300" width="100%">
			<tr>
				<td bgcolor="#993300">
					<table border="0" cellpadding="0" cellspacing="2" bgcolor="#ffffcc" width="100%">
						<tr>
							<td bgcolor="#ffffcc"><b>&#25805;&#20316;&#27493;&#39588;:</b> 
                              &#23558; &quot;Property&quot;
                              &#27169;&#24335;&#24212;&#29992;&#21040; <b>Reservation.name</b>
                              &#21644; <b>Agent.name</b>.
                              &#32473;&#27599;&#20010;&#23646;&#24615;&#19968;&#20010; <b>get</b> 
                              &#26041;&#27861;, &#20294;&#19981;&#35201; <b>set</b> 
                              &#26041;&#27861;.</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
        <p>&#20351;&#29992;&#29305;&#24615;&#30340;&#21491;&#38190;&#33756;&#21333;&#20013;&#26469;&#24212;&#29992;
        &quot;Properties&quot; &#27169;&#24335;.
        &#24403;&#20320;&#20174;&#27169;&#24335;&#21015;&#34920;&#20013;&#36873;&#25321;
        &quot;Properties&quot; &#26102;,
        &#27169;&#24335;&#31383;&#21475;&#30340;&#21491;&#36793;&#20801;&#35768;&#20320;&#20462;&#25913;&#23646;&#24615;&#30340;&#21517;&#31216;,
        &#31867;&#22411;&#20197;&#21450;&#26159;&#21542;&#26377; getter
        &#26041;&#27861;, &#26159;&#21542;&#26377; setter &#26041;&#27861;,
        &#26159;&#21542;&#26377;&#29305;&#24615;.</p>
		<p><img src="images/airline/pro6_patterndialognode.png" width="522" height="421" border="0" alt="Pattern window" hspace="10" vspace="10"></p>
        <p>&#22914;&#26524;&#20320;&#20462;&#25913;&#20102; &quot;Name&quot;
        &#20013;&#30340;&#25991;&#23383;, Together
        &#23558;&#20462;&#25913;&#29305;&#24615;&#21644;&#26041;&#27861;&#30340;&#21517;&#23383;.
        &#22914;&#26524;&#20320;&#27809;&#26377;&#36873;&#20013; &quot;Attribute&quot;
        &#26694;, Together
        &#23558;&#24443;&#24213;&#21024;&#38500;&#29305;&#24615;.</p>
        <p>&#22914;&#26524;&#20320;&#24819;&#21019;&#24314;&#19968;&#20010;&#26032;&#30340;&#23646;&#24615;,
        &#32780;&#19981;&#26159;&#20351;&#29992;&#24050;&#23384;&#22312;&#30340;&#29305;&#24615;,
        &#20320;&#21487;&#20197;&#20351;&#29992;&#31867;&#30340;&#21491;&#38190;&#33756;&#21333;&#20013;&#30340;
        &quot;Member by Pattern&quot; &#36873;&#39033;.</p>
		<p></p>
		<hr>
		<p class="head3"><a name="link"></a>&#23558;&#27169;&#24335;&#24212;&#29992;&#21040;&#36830;&#25509;</p>
		<p></p>
		<table border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
			<tr>
				<td bgcolor="#CCCCCC">
					<table border="0" cellpadding="5" cellspacing="2">
						<tr>
							<td valign="top" bgcolor="white">
								<p><img src="images/airline/flightreslink.png" width="179" height="259" border="0" alt="Aggregation link" hspace="5"></p>
							</td>
							<td valign="top" bgcolor="white">
                                <p>&#24038;&#22270;&#26159; <b>AirlinePD</b> 
                                &#31867;&#22270;&#30340;&#19968;&#37096;&#20998;,
                                &#23427;&#26174;&#31034;&#20102;&#20174; <b>Flight</b>
                                &#21040; <b>Reservation</b>
                                &#30340;&#20851;&#32852;. UML
                                &#27169;&#22411;&#22270;&#21482;&#34920;&#31034;&#36825;&#20010;&#20851;&#32852;&#26159;&#19968;&#20010;&#32858;&#21512;.
                                &#27169;&#22411;&#22270;&#27809;&#26377;&#26174;&#31034;&#20219;&#20309;&#23454;&#38469;&#30340;&#23454;&#29616;&#20449;&#24687;.
                                &#32858;&#21512;&#20195;&#30721;&#21040;&#24213;&#26159;
                                collection?, array?, vector?, &#36824;&#26159; hash
                                table &#21602;?</p>
                                <p>&#24212;&#35813;&#30001;&#31243;&#24207;&#21592;&#26469;&#36873;&#25321;&#36866;&#24403;&#30340;&#20195;&#30721;&#23454;&#29616;.
                                &#36830;&#25509;&#27169;&#24335;&#25552;&#20379;&#20102;&#19968;&#20123;&#24110;&#21161;.</p>
								<table border="0" cellpadding="0" cellspacing="2" bgcolor="#993300" width="100%">
									<tr>
										<td bgcolor="#993300">
											<table border="0" cellpadding="0" cellspacing="2" bgcolor="#ffffcc" width="100%">
												<tr>
													<td bgcolor="#ffffcc"><b>&#25805;&#20316;&#27493;&#39588;:</b> 
                                                      &#23558; &quot;<nobr><b>Aggregation as ArrayList</b>&quot;</nobr>
                                                      &#27169;&#24335;&#24212;&#29992;&#21040;&#20174; <b>Flight</b>
                                                      &#21040; <b>Reservation</b>
                                                      &#30340;&#36830;&#25509;.</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
								<p>&#26377;&#20004;&#31181;&#26041;&#27861;&#24212;&#29992;&#36830;&#25509;&#27169;&#24335;:</p>
								<ol>
									<li>&#23545;&#20110;&#24050;&#23384;&#22312;&#30340;&#36830;&#25509;,
                                      &#22312;&#23427;&#30340;&#21491;&#38190;&#33756;&#21333;&#20013;&#36873;&#25321; <b>Ch</b><b><nobr>oose Pa</nobr></b><b>ttern</b> 
                                      &#39033;.
									<li>&#22914;&#26524;&#36830;&#25509;&#19981;&#23384;&#22312;,
                                      &#37027;&#20040;&#21487;&#20197;&#20351;&#29992;&#27169;&#24335;&#26469;&#21019;&#24314;&#36830;&#25509;.
                                      &#27169;&#24335;&#36830;&#25509;&#25353;&#32445;(<img src="images/icons/associationbypatternicon.png" width="14" height="16" border="0" hspace="2" align="top">)&#22312;
                                      Designer &#24037;&#20855;&#26465;&#20013;.
								</ol>
                                <p>&#23545;&#20110;&#36825;&#20004;&#31181;&#24773;&#20917;, Together
                                &#37117;&#20250;&#26174;&#31034; Association Pattern
                                &#23545;&#35805;&#26694;.</p>
							</td>
						</tr>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -