




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
25五月20231第六講:SDL中面向對象概念25五月20232SDL中的類typeinstantiatesasspecializesasparameterizedtypedefinitionwithsomecontextparametersboundiswithallcontextparametersboundisparameterizesasinstanceimpliedtype25五月20233代理類——代理類的定義(1)<agenttypediagram>::=<systemtypediagram>|<blocktypediagram>|<processtypediagram><systemtypediagram>::=<framesymbol>contains
{<systemtypeheading><agenttypediagramcontent>}[isassociatedwith<packageusearea>]<systemtypeheading>::=systemtype[<qualifier>]<systemtypename><agenttypeadditionalheading>25五月20234代理類——代理類的定義(2)<blocktypediagram>::=<framesymbol>contains
{<blocktypeheading><agenttypediagramcontent>}
isconnectedto{{<gateondiagram>*}set}[isassociatedwith<packageusearea>]<blocktypeheading>::=<typepreamble>
blocktype[<qualifier>]<blocktypename><agenttypeadditionalheading><typepreamble>::=[<virtuality>|<abstract>]<virtuality>::=virtual|redefined|finalized<abstract>::=abstract25五月20235代理類——代理類的定義(3)<processtypediagram>::=<framesymbol>contains
{<processtypeheading><agenttypediagramcontent>}
isconnectedto{{<gateondiagram>*}set}[isassociatedwith<packageusearea>]<processtypeheading>::=<typepreamble>
processtype[<qualifier>]<processtypename><agenttypeadditionalheading>25五月20236代理類——代理類的定義(4)<agenttypeadditionalheading>::=[<formalcontextparameters>][virtualityconstraint]<agentadditionalheading><virtualityconstraint>::=atleast<identifier><agentadditionalheading>::=[<specialization>][<agentformalparameters>]<specialization>::=inherits<typeexpression>[adding]<agentformalparameters>::=(<parametersofsort>{,<parametersofsort>}*)<parametersofsort>::=<variablename>{,<variablename>}*<sort>25五月20237processtypeGame(playerPid)GameidtoplayerevendclcountInteger:=01(3)ProbeResultEndGameg1GameidWin,LoseScoreg2Gameoverg3進程類定義Gate定義信號列表25五月20238processtypeGame(playerPid)2(3)Probe,Result,EndGameg1Gameid,Win,Lose,Scoreg2g3Gameovercount:=count+1-evennoneLosetoplayerProbeProbenoneevenWintoplayeroddcount:=count-1-25五月20239processtypeGame(playerPid)3(3)Probe,Result,EndGameg1Gameid,Win,Lose,Scoreg2g3GameoverGameover(player)*ResultEndGameScore(count)toplayer-25五月202310代理類的實例化systemDemongamesignalNewgame,Probe,Result,Endgame,Gameid,Win,Lose,Score(Integer)GameservermsginmsgoutNewGame,Probe,EndGameResult,GameidWin,ScoreLose,25五月202311blockGameserversignalGameover(Pid)GameMonitor(1,1)g3
Games(0,):Gameg1g2Gameid,Win,Lose,ScoreNewgameR1R4R3GameoverProbe,Result,EndgameR2引用進程類實例化Gate與信道相連msginmsgout25五月202312類的參數化形式化上下文參數定義
<formalcontextparameters>::=<contextparametersstart><formalcontextparameterlist><contextparametersend><contextparametersstart>::=<lessthansign><contextparametersend>::=<greaterthansign><formalcontextparameterlist>::=<formalcontextparameter>{<end><formalcontextparameter>}*25五月202313<formalcontextparameter>::=<agentcontextparameter>|<procedurecontextparameter>|<remoterprocedurecontextparameter>|<signalcontextparameter>|<variablecontextparameter>|<timercontextparameter>|…<agentcontextparameter>::={process|block}<agentname>[<agentconstraint>]<agentconstraint>::={atleast|<colon>}<agenttypeidentifier>|<agentsignature><agentsignature>::=<sortlist>25五月202314processtypeMonitor<processLog>EventtoLogblockB1MonitorLogP1Monitors:Monitor<logP1>g1ToLog[Event]ToMon[..][..]C125五月202315類的特例化(繼承)<specialization>::=inherits<typeexpression>[adding]<typeexpression>::=<basetype>[<actualcontextparameters>]<basetype>::=<identifier>25五月202316blocktypeSpeakingGameServerinheritsGameserveradding
Gamesg2LoadSpeakerR3R4[Gameid,Win,Lose,Score,voiceWin,voiceLose]mo[voiceWin,voiceLose]子類中添加進程25五月202317processtypeSpecialGameinheritsGameadding
g4[Evil]Evil-evenEvilevenodd子類中增加遷移25五月202318類中的虛定義(virtual)processtypeGame(playerPid)2(3)evennoneoddcount:=count+1-WintoplayernoneevenProbe,Result,EndGameg1Gameid,Win,Lose,Scoreg2g3GameoverLosetoplayerProbevirtualProbevirtualcount:=count-1-25五月202319processtypeOppositeGameinheritsGame1(1)oddcount:=count-1-LosetoplayerProberedefinedevencount:=count+1-WintoplayerProberedefined25五月202320虛定義可以應用在下列符號中:進程開始符過程開始符連續信號優先輸入自發輸入遠端過程輸入25五月202321SDL中的選擇域usesig_packagesynonymnotATMonlyBoolean=external;systembankSystemBankHeadQuarterBankHeadQuarterATMC1[card,code,amount][cash,receipt,(failure)]C2[transactOK,transactNOK,(failure)][
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 軟件測試中的質量控制與保證機制試題及答案
- 道路冷補修復材料試題及答案
- 計算機三級考試新趨勢試題及答案
- 嵌入式系統調試技巧考題試題及答案
- 數據庫存儲過程撰寫技巧試題及答案
- 通信設備專業高頻信號處理維修考核試卷
- 四級軟件測試工程師訪問量提升試題及答案
- 基于MySQL的后臺數據庫管理技巧試題及答案
- 嵌入式系統的市場潛力分析試題及答案
- 敏捷實踐下的測試反饋循環試題及答案
- 學習課件鑄牢中華民族共同體意識PPT
- 期貨交易制度跟期貨交易流程課程(-)課件
- 病害與殺菌劑基礎知識
- 體育與健康PPT(中職)全套完整教學課件
- 鐵道車輛制動裝置檢修PPT(高職)完整全套教學課件
- 叉車應急預案及演練記錄
- 直接打印800字作文紙
- 肉毒素培訓的學習資料
- DB34T 5006-2023 太陽能光伏與建筑一體化技術規程
- D503-D505防雷與接地(下冊)彩色版
- 大學期末復習-中獸醫學期末考試重點
評論
0/150
提交評論