軟件體系結(jié)構(gòu)過程調(diào)用體系結(jié)構(gòu)CallReturnSystem

上傳人:san****019 文檔編號(hào):20651086 上傳時(shí)間:2021-04-08 格式:PPT 頁(yè)數(shù):71 大小:686.81KB
收藏 版權(quán)申訴 舉報(bào) 下載
軟件體系結(jié)構(gòu)過程調(diào)用體系結(jié)構(gòu)CallReturnSystem_第1頁(yè)
第1頁(yè) / 共71頁(yè)
軟件體系結(jié)構(gòu)過程調(diào)用體系結(jié)構(gòu)CallReturnSystem_第2頁(yè)
第2頁(yè) / 共71頁(yè)
軟件體系結(jié)構(gòu)過程調(diào)用體系結(jié)構(gòu)CallReturnSystem_第3頁(yè)
第3頁(yè) / 共71頁(yè)

下載文檔到電腦,查找使用更方便

14.9 積分

下載資源

還剩頁(yè)未讀,繼續(xù)閱讀

資源描述:

《軟件體系結(jié)構(gòu)過程調(diào)用體系結(jié)構(gòu)CallReturnSystem》由會(huì)員分享,可在線閱讀,更多相關(guān)《軟件體系結(jié)構(gòu)過程調(diào)用體系結(jié)構(gòu)CallReturnSystem(71頁(yè)珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。

1、軟件體系結(jié)構(gòu) 過程調(diào)用體系結(jié)構(gòu) Call/Return Systems 孫志崗 2 2021/4/6 History Main program and subroutines Decomposition into processing steps with single- threaded control 單線程控制,劃分為若干處理步驟 Functional modules Aggregation of processing steps into modules 把處理步驟集成到模塊內(nèi) Abstract Data Types Bundle operations and data, hide

2、 representations and other secrets 操作和數(shù)據(jù)捆綁在一起,隱藏實(shí)現(xiàn)和其他秘密 3 2021/4/6 History Objects Methods (bound dynamically), polymorphism (subtypes), reuse (through inheritance) 方法(動(dòng)態(tài)綁定),多態(tài)(子類),重用(繼承) OO Architectures Objects as separate processes/threads 對(duì)象活動(dòng)與不同的進(jìn)程 /線程 Client-server, tiered styles Components M

3、ultiple interfaces, binary compatibility, advanced middleware (多個(gè)接口,二進(jìn)制兼容,高級(jí)中間件) 4 2021/4/6 Main Program and Subroutine 5 2021/4/6 Main Program and Subroutine Hierarchical decomposition: 逐步分解 Based on definition-use relationship 基于定義 使用關(guān)系 Uses procedure call as interaction mechanism 用過程調(diào)用作為交互機(jī)制 Si

4、ngle thread of control: 單線程控制 Supported directly by programming languages 程序設(shè)計(jì)語言直接支持 6 2021/4/6 Main Program and Subroutine Hierarchical reasoning: 推論 Correctness of a subroutine depends on the correctness of the subroutines it calls 子程序的正確性取決于它調(diào)用的子程序的正確性 Subsystem structure implicit: 子系統(tǒng)的結(jié)構(gòu)不清晰 Sub

5、routines typically aggregated into modules 子程序通常合成為模塊 7 2021/4/6 Main Program and Subroutine 8 2021/4/6 Criteria for Modularization What is a module? Common view: a piece of code. Too limited. Compilation unit, including related declarations and interface (編譯單元,包含相關(guān)的聲明和接口) Parnas: a unit of work.

6、Why modularize a system, anyway? Management: Partition the overall development effort divide and conquer (分而治之 ) Evolution: Decouple parts of a system so that changes to one part are isolated from changes to other parts 進(jìn)化:降低模塊間的耦合度,使改變一個(gè)模塊不會(huì)影響其他 Understanding: Permit system to be understood as comp

7、osition of mind-sized chunks 理解:系統(tǒng)可以被理解成若干個(gè)易于理解的模塊的組合 Key issue: what criteria to use for modularization 9 2021/4/6 Modularization Problems Access to internal representation: Vulnerability: Visible representations can be manipulated in unexpected, undesired, and dangerous ways Nonlocality: If the w

8、ay something is used depends on its implementation, you must find all uses to change it (e.g. Y2K) Forced distribution of knowledge: Non-uniform referents: Syntax may reveal structure (If you export a data structure, how does its user iterate through it?) 10 2021/4/6 Modularization Problems Couplin

9、g: Instance dependence: When multiple instances of a given structure are active, they must remain independent Families of definitions: (眾說紛紜 ) Dynamic binding: If shared definitions involve type variants, function variants must be chosen at run-time 11 2021/4/6 Module Decomposition Parnas Hide secr

10、ets. OK, whats a secret? Representation of data Properties of a device, other than required properties Mechanisms that support policies Try to localize future change Hide system details likely to change independently 把可能改變的系統(tǒng)細(xì)節(jié)分別隱藏 Expose in interfaces assumptions unlikely to change 把改變的可能不大的放到接口當(dāng)中

11、Use functions to allow for change Theyre easier to change than visible representation 12 2021/4/6 Key Word In Context (KWIC) Problem Description: The KWIC index system accepts an ordered set of lines, each line is an ordered set of words, and each word is an ordered set of characters. KWIC索引系統(tǒng)接受一些行

12、,每行有若干字,每個(gè)字由 若干字符組成 Any line may be circularly shifted by repeatedly removing the first word and appending it at the end of the line. 每行都可以循環(huán)移位。重復(fù)地把第一個(gè)字刪除,然后 接到行末 The KWIC index system outputs a listing of all circular shifts of all lines in alphabetical order. KWIC把所有行的各種移位情況按照字母表順序輸出 13 2021/4/6

13、Key Word In Context (KWIC) Inputs: Sequence of lines Pipes and Filters Architectures for Software Systems Outputs: Sequence of lines, circularly shifted and alphabetized and Filters Pipes Architectures for Software Systems Filters Pipes and for Software Systems Architectures Pipes and Filters Softwa

14、re Systems Architectures for Systems Architectures for Software 14 2021/4/6 Design Considerations Change in Algorithm Eg., batch vs incremental Change in Data Representation Eg., line storage, explicit vs implicit shifts Change in Function Eg., eliminate lines starting with trivial words Performanc

15、e Eg., space and time Reuse Eg., sorting 15 2021/4/6 Solution 1 Decompose the overall processing into a sequence of processing steps. Read lines; Make shifts; Alphabetize; Print results Copy data in modules 數(shù)據(jù)在每個(gè)模塊內(nèi)拷貝 Determine the representation of data between neighbors. 相鄰模塊間約定好數(shù)據(jù)格式 Usually use

16、the same representation of data for all modules 通常完全采用相同的數(shù)據(jù)格式,也最好這樣做 16 2021/4/6 Solution 1: Modularization Module 1: Input Read data lines and pass to the next module 按行讀取數(shù)據(jù),傳遞給下一模塊 Module 2: Circular Shift The first lines coming make it work 第一行數(shù)據(jù)到來后開始運(yùn)作 Transmit the old and new lines to the next

17、 把原始數(shù)據(jù)行,和新的移位后的行輸出給下一模塊 Module 3: Alphabetize Collect data lines, buffer. All done, begin to work 接收行數(shù)據(jù),緩存。當(dāng)數(shù)據(jù)都到達(dá)后,開始排序 Finish, output results 排序完畢,輸出結(jié)果 17 2021/4/6 Solution 1: Modularization Module 4: Output Called after Alphabetization 排序后被調(diào)用 Read sorted data lines, print formatted output 讀取排序生成的

18、數(shù)據(jù),逐行格式化輸出 18 2021/4/6 Architecture of Solution 1 19 2021/4/6 Properties of Solution 1 Concurrent partly 部分并行處理 Use lots of memory 空間消耗很大 Every modules should know the representation of data 每個(gè)模塊都必須知道輸入和輸出的數(shù)據(jù)格 式 20 2021/4/6 Solution 2 Decompose the overall processing into a sequence of processing

19、 steps. Read lines; Make shifts; Alphabetize; Print results Each step transforms the data completely. 每一步完全轉(zhuǎn)換數(shù)據(jù) Intermediate data stored in shared memory. Arrays of characters with indexes 帶索引的字符數(shù)組 Relies on sequential processing 串行處理 21 2021/4/6 Solution 2: Modularization Module 1: Input Reads dat

20、a lines and stores them in core. Storage format: 4 chars/machine word; array of pointers to start of each line. Module 2: Circular Shift Called after Input is done. Reads line storage to produce new array of pairs: (index of 1st char of each circular shift, index of original line) Module 3: Alphabet

21、ize Called after Circular Shift. Reads the two arrays and produces new index. 22 2021/4/6 Solution 2: Modularization Module 4: Output Called after alphabetization and prints nicely formatted output of shifts Reads arrays produced by Modules 1 procedural interface Storage format: not specified at th

22、is point Module 2: Input Reads lines of data and stores using Characters ADT Module 3: Circular Shift Provides access functions to characters in circular shifts Requires setup as initialization after Input is done 27 2021/4/6 Solution 3: Modularization Module 4: Alphabetize Provides index of circul

23、ar shift Alph called to initialize after Circular Shift Module 5: Output Prints formatted output of shifted lines Module 6: Master Control Handles sequencing of other modules 28 2021/4/6 Architecture of Solution 3 29 2021/4/6 Properties of Solution 3 Module interfaces are abstract hide data repres

24、entations could be array + indices, as before or lines could be stored explicitly hide internal algorithm used to process that data could be lazy or eager evaluation require users to follow a protocol for correct use initialization, error handling Allows work to begin on modules before data represen

25、tations are designed. Could result in same executable code as solution 2. according to Parnas, at least 30 2021/4/6 Comparisons - 1 Change in Algorithm Solution 1: permits alternatives Solution 2: batch algorithm hard-wired Solution 3: permits alternatives Change in Data Representation Solution 1:

26、data formats are common among many modules or two modules Solution 2: data formats are common among many modules Solution 3: data formats are hidden 31 2021/4/6 Comparisons - 2 Change in Function Solution 1: easy if adding a new filter Solution 2: easy if adding a new phase of processing Solution 3

27、: modularization doesnt give particular help. But we can use inheritance. Performance Solution 1: Bad in space and good in speed Solution 2: Good Solution 3: Probably not as good, but might be 32 2021/4/6 Comparisons - 3 Reuse Solution 1: Poor since tied to particular data formats Solution 2: Poor

28、since tied to particular data formats Solution 3: Better 33 2021/4/6 KWIC: Summary What does this example teach us? For some quality attributes (space/time performance, change of functional flow) shared memory can be a good architecture For other quality attributes (reuse, general modifiability, po

29、rtability) ADT solution is better The ADT solution also permits a divide-and-conquer approach to software development in terms of allocation of work in terms of cognitive effort This thinking leads to (led to) object architectures. 34 2021/4/6 Encapsulation/Information Hiding Parnas: Hide secrets (

30、not just representations) Booch: Objects behavior is characterized by actions that it suffers and that it requires 對(duì)象的行為體現(xiàn)在其接受和請(qǐng)求的動(dòng)作 35 2021/4/6 Encapsulation/Information Hiding Practically speaking: Object has state and operations, but also has responsibility for the integrity of its state 對(duì)象擁有狀態(tài)和

31、操作,也有責(zé)任維護(hù)狀態(tài) Object is known by its interface 通過接口了解對(duì)象 Object is probably instantiated from a template 對(duì)象一般是一個(gè)模板(類)的實(shí)例 Object has operations to access and alter state and perhaps generator 通過操作來存取、改變和產(chǎn)生對(duì)象的狀態(tài) There are different kinds of objects (e.g., actor, agent, server) 36 2021/4/6 Data Abstracti

32、on or Object- Oriented 37 2021/4/6 Elements of Object Architectures Encapsulation: Restrict access to certain information 封裝 :限制對(duì)某些信息的訪問 Interaction: Via procedure calls or similar protocol 交互 :通過過程調(diào)用或類似的協(xié)議 Polymorphism: Choose the method at run- time 多態(tài) :在運(yùn)行時(shí)選擇具體的操作 Inheritance: Keep 1 definition

33、of shared functionality 繼承 :對(duì)共享的功能保持唯一的接口 38 2021/4/6 Elements of Object Architectures Advantage: Reuse and maintenance: Exploit encapsulation and locality to increase productivity 復(fù)用和維護(hù) :利用封裝和聚合提高生產(chǎn)力 Problem: Management of many objects: Need structure on large set of definitions 管理大量的對(duì)象 :怎樣確立大量對(duì)象的

34、結(jié)構(gòu) Note: the object architecture often closely resembles the object programming style. Is this a problem? 注意:面向?qū)ο篌w系結(jié)構(gòu),通常和面向?qū)ο缶幊田L(fēng)格 很類似,這是個(gè)問題嗎? 39 2021/4/6 Finding Objects: Model the Real World Its intuitive: if we understand the domain then we are led to a natural system structure based on the domai

35、n. 直覺很重要:如果對(duì)現(xiàn)實(shí)領(lǐng)域理解得很好,那么 我們?cè)O(shè)計(jì)的體系結(jié)構(gòu)就自然而然地基于現(xiàn)實(shí)的結(jié) 構(gòu) The real world doesnt change much, so systems that model it are unlikely to change much either. 現(xiàn)實(shí)世界結(jié)構(gòu)變化很小,按照其結(jié)構(gòu)建立的體系 結(jié)構(gòu)變化也會(huì)很小 40 2021/4/6 Finding Objects: Model the Real World Capture families of related designs through use of templates, and inherit

36、ance 通過類和繼承表達(dá)同一家族的事物 But what happens when you arent modeling the real world (e.g. system for manipulating FSMs, fuzzy logic robot controller, natural language translation system)? 但是當(dāng)你不是為現(xiàn)實(shí)世界建模時(shí),怎么辦?(比 如,你在寫 FSM管理軟件,模糊邏輯機(jī)器人控制, 翻譯軟件) 41 2021/4/6 Problems with Object Approaches Managing many objects

37、 vast sea of objects requires additional structuring 對(duì)象的海洋需要額外的結(jié)構(gòu)來容納 hierarchical design suggested by Booch and Parnas Managing many interactions single interface can be limiting this facilitated communication between the software engineers and the customers/users 盡可能地按照物理組件的形式進(jìn)行分解。這使開 發(fā)者和用戶之間更容易交流

38、Modeling of malfunctions encapsulated within components affected 把故障封裝在引起該故障的組件內(nèi) 61 2021/4/6 Structural Modeling Style: Major Object Types Two parts: application and executive Application: modeling objects subsystems components Executive: real-time scheduling, instructor/operator interface, data sh

39、aring/integrity objects periodic sequencer event handler timeline synchronizer surrogates 62 2021/4/6 Application Component/Patterns S u b s y s t e m C o n t r o l l e r C o m p o n e n t i m p o r t p r o c e s s _ e v e n t u p d a t e c o n f i g u r e c o n f i g u r e p r o c e s s _ e v e n

40、t u p d a t e 63 2021/4/6 Salient Features of Application Supports strict two-level hierarchical pattern of decomposition and interaction. Each subsystem controller has multiple components as children. Communication between subsystems is handled by subsystem controllers, not independent components.

41、 Each component can communicate only with its parent. There are limited methods. normal cyclic operation aperiodic operation modify configuration 64 2021/4/6 Executive Components T i m e l i n e S y n c h r o n i z e r S u r r o g a t e P e r i o d i c S e q u e n c e r E v e n t H a n d l e r A i

42、r V e h i c l e S u b s y s t e m s e n d r e c e i v e i m p o r t e x p o r t u p d a t e i m p o r t i m p o r t u p d a t e c o n f i g u r e p r o c e s s e _ e v e n t s e n d c o n f i g u r e g e t _ o u t b o u n d _ m s g c o n s t i t u e n t _ e v e n t p r o c e s s _ e v e n t N e t w

43、o r k t o O t h e r P r o c e s s o r s 65 2021/4/6 Salient Features of Executive Executive: controls real-time scheduling, manages events, invokes data sharing. the timeline synchronizer manages the real-time scheduling on a single hardware platform and synchronization with other computers periodi

44、c tasks are controlled by the periodic sequencer (principally import and update) aperiodic events are handled by the event handler surrogates represent non-native subsystems on a computer and hides platform specifics from the rest of the executive and the application 66 2021/4/6 Responsibilities of

45、 Components Timeline synchronizer maintains global time for single processor coordinates time with other processors The periodic sequencer controls schedule (invoking subsystems at the right rates/orders). The event handler manages aperiodic events (configure, send, etc.). Surrogates manage communic

46、ation between air vehicle, environment, and operator. 67 2021/4/6 How Structural Model Achieves Qualities Real-time performance is managed via a strict separation of concerns. Scheduling is managed by the executive. Application does the modeling. Subsystems are given a time budget and must complete

47、 their computations within that time. Frame overruns are recorded for performance monitoring and tuning. Subsystems run independently of each other. 68 2021/4/6 How Structural Model Achieves Qualities Modifiability is managed by a division of functionality that matches the air vehicle wherever poss

48、ible making components and subsystems standalone; components/subsystems do not communicate directly with each other strict patterns of object interactions This avoids spaghetti objects. 69 2021/4/6 How Structural Model Achieves Qualities Integrability is achieved by the limited paths of communicati

49、on between components and subsystems. Components are called by their subsystem, which manages their data needs. Subsystems are similarly called by the executive. There is little direct coupling between objects (unlike in unconstrained object architectures). 70 2021/4/6 Side Issue: Template-Based De

50、velopment Templates (forms) were developed for specifying functions. A generator was applied to the templates to insert coordination and communication interfaces; functionality is kept separate from infrastructure. 71 2021/4/6 Flight Simulation: Summary Architecture was the basis for achieving qual

51、ities. A structural model uses a minimal number of patterns to construct flight simulators; this eases system comprehension. The strict limitations on data and control flow simplify integrability, modifiability, and performance tuning. Modifiability is also eased by the direct mapping of air vehicle subsystems to software subsystems.

展開閱讀全文
溫馨提示:
1: 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
5. 裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

相關(guān)資源

更多
正為您匹配相似的精品文檔
關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號(hào):ICP2024067431號(hào)-1 川公網(wǎng)安備51140202000466號(hào)


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺(tái),本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng),我們立即給予刪除!