博碩士論文 105522120 詳細資訊




以作者查詢圖書館館藏 以作者查詢臺灣博碩士 以作者查詢全國書目 勘誤回報 、線上人數:10 、訪客IP:3.236.222.124
姓名 徐國維(HSU, KUO-WEI)  查詢紙本館藏   畢業系所 資訊工程學系
論文名稱 條件判斷式事件驅動程式設計之C語言擴充
(An Event-driven Programming Extension of Conditional Expression in C Language)
相關論文
★ 以演算法程式設計競賽試題為例使用Big-O AST靜態分析函式時間複雜度★ 流程圖式特定領域語言之設計與實作
★ TOCTOU 漏洞的靜態分析與實作★ 用於繪製風力發電控制邏輯之特定領域語言
★ 在Java程式語言中以雙向結構表達數學公式間關聯之設計與實作★ 支援模組化規則製作之程式碼轉換工具
★ 基於替代語意的 pandas DataFrame 靜態型別檢查器★ 自動化時間複雜度分析的設計與實作–從軟體層面評估嵌入式系統的功率消耗
★ 以震波層析成像為應用之特定領域語言實作與分析
檔案 [Endnote RIS 格式]    [Bibtex 格式]    [相關文章]   [文章引用]   [完整記錄]   [館藏目錄]   至系統瀏覽論文 ( 永不開放)
摘要(中) 由於大多的程式都具有 UI 介面,不管是網頁程式,又或是作業系統,都是透過使用者的操作來決定程式的執行順序,使得程式與使用者的互動越來越重要。這種互動性高的程式在設計上往往透過事件驅動的方式來完成。
事件驅動的程式設計是一種現在常見的電腦程式設計模型,程式執行的流程相較以往由程式設計師來決定,事件驅動的程式則是由與使用者或是與其他程式的互動(像是訊息的接收)來做決定。事件驅動的程式在撰寫難易度上,因使用的語言而有所不同。常見的語言像是 C#、JAVA、PYTHON 等,這些語言在基礎上就有支援事件的語法,因此使用上較為輕鬆。而當今廣泛運用的一種語言:C 語言,因為缺乏語言基礎上的支援,大多只能靠使用者的經驗去設計。
本文將提出一套工具 C Event Dispatcher,協助程式設計者在 C 語言上事件驅動程式的撰寫。此工具的特色在於他的事件觸發條件不局限於以往使用的 timeout 與 signal,而是採用較為靈活的條件判斷式,讓程式設計者可以使用變數、邏輯運算等方式作事件的觸發。這樣的彈性讓我們在使用事件驅動的架構設計程式的控制表或有限狀態機時更加便利,可以依據不同的狀態設置不同的轉換條件。尤其是運用在嵌入式系統上,更可以達到動態的管理程式系統模型。不僅在使用上更加靈活,也增加程式碼的可維護性。
摘要(英) Now a day, most of programs having UI interfaces. Whether it is a website program or an operating system, the process of the programs is determined by the user′s operating. So that, the interaction between the program and the user is more and more important. The design of such programs is often using event-driven design.
Event-driven programming is a common programming paradigm in which the flow of program is determined by the event such as user motions or messages from other programs. How difficult it is to design the event-driven programs is also depending on the programming language. Programming languages like C#, JAVA, PYTHON, etc., are easier to design event-driven programs because of the supporting of language itself. However, one of widely using language: C language, because of the lack of language-based support, can only design event-driven programs by the experience from designers.
This research will present a tool which is called “C Event Dispatcher”(CED) to assist programmers in writing event-driven programs in C language. The feature of CED tool is that it use different way to trigger the event handler. Without using timeout and signal, it use conditional expression to trigger the handler, giving user more flexibility to design event-driven program. User can use the mechanism of conditional expression to monitor a event variable, calling the event handler depending on the condition of the event variable. The CED tool also support the publish–subscribe pattern, increasing the flexibility of event-driven architecture and the maintainability of the code. The finite-state machine built by CED tool can dynamically decrease and increase the states in the finite-state machine. This advantage is suitable for using on the embedded system. It can make the embedded system more flexible and maintainable.
關鍵字(中) ★ 事件驅動程式設計
★ 事件驅動架構
★ 有限狀態機
★ 嵌入式系統
★ 事件分配器
關鍵字(英) ★ Event-driven Programming
★ Event Driven Architecture
★ Embedded Systems
★ Finite-state Machine
★ Dispatcher
論文目次 摘要 i
Abstract ii
誌謝 iv
目錄 v
圖目錄 viii
表目錄 ix
一、 緒論 1
1-1 簡介 1
1-2 Event-driven programming 4
1-3 Finite-state Machine (FSM) 6
二、 動機 8
2-1 事件驅動程式在C語言上的實作 8
2-1-1 GLib 8
2-1-2 Libevent 9
2-2 事件觸發 10
2-3 FSM使用事件驅動的架構上的改進 13
三、 條件判斷式事件分配器 14
3-1 C Event Dispatcher 14
3-2 Broker Topology事件驅動架構 15
3-2-1 Broker Topology的執行流程 16
3-2-2 事件驅動架構的特性 17
3-2-3 事件驅動架構構範例 18
3-3 C Event Dispatcher範例 20
3-3-1 新增事件範例 23
3-3-2 C Event Dispatcher的特色 24
3-4 在Finite-state Machine上的應用 26
3-4-1 事件驅動架構下的Finite-state Machine 26
3-4-2 FSM範例Coffee Vender Machine 27
3-4-3 使用CED增加FSM擴展性 31
四、 C Event Dispatcher的實作 37
4-1 條件判斷式觸發 38
4-1-1 Lex與YACC 38
4-1-2 CED中的掃描器 40
4-1-3 CED中的語法解析器 41
4-2 CED的結構設計 43
4-2-1 Types and Values 43
4-2-2 Functions 44
五、 分析討論 47
5-1 GLib中的Event Loop 47
5-1-1 事件觸發方式 48
5-1-2 應用範圍 49
5-1-3 討論 50
5-2 FSM的實作 51
5-2-1 FSM實作:if-else 51
5-2-2 FSM實作:狀態表 53
5-2-3 FSM實作:C Event Dispatcher 54
5-2-4 討論 57
六、 相關研究 58
6-1 libsigc++ 58
6-2 C# Delegate 58
七、 結論 59
八、 未來展望 60
九、 參考文獻 61
參考文獻 [1] "TIOBE Programming Community Index," [Online]. Available: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html. [Accessed 8 5 2019].
[2] F. Long, D. Mohindra, R. C. Seacord, D. F. Sutherland and D. Svoboda, Java Coding Guidelines, Addison-Wesley, 2013.
[3] M. Ferber, S. Hunold, B. Krellner, T. Rauber, T. Reichel and G. Rünger, "Reducing the Class Coupling of Legacy Code by a Metrics-Based Relocation of Class Members," CEE-SET′09 Proceedings of the 4th IFIP TC 2 Central and East European conference on Advances in Software Engineering Techniques, pp. 202-214 , 12-14 10 2009.
[4] S. Hansen, T. Fossum, U. -. Parkside and S. -. Potsdam, Event Based Programming, Kenosha WI, 2010.
[5] E. Czaplicki and S. N. Chong, "Asynchronous Functional Reactive Programming for GUIs," 34th ACM SIGPLAN Conference on Programming Language Design and Implementation - PLDI ’13, Seattle Washington, pp. 411-422, 16-22 June 2013.
[6] J. Kopják and J. Kovács, "Event driven software modeling of combinational logic network based control programs," 2012 IEEE 16th International Conference on Intelligent Engineering Systems (INES), 30 July 2012.
[7] R. A. Sayle, "A Superoptimizer Analysis of Multiway Branch Code Generation," Proceedings of the GCC Developers’ Summit, 17-19 June 2008.
[8] N. P. Dash, R. Dasgupta, J. Chepada and A. Halder, "Event Driven Programming for Embedded Systems-A Finite State Machine Based Approach," ICONS 2011, The Sixth International Conference on Systems, January 2011.
[9] J. Kopják and J. Kovács, "Event-driven control program models running on embedded systems," 2011 6th IEEE International Symposium on Applied Computational Intelligence and Informatics (SACI), 09 June 2011.
[10] E. Cheong, J. Liebman, J. Liu 且 F. Zhao, “TinyGALS: a programming model for event-driven embedded systems,” SAC ′03 Proceedings of the 2003 ACM symposium on Applied computing, pp. 698-704, 09 - 12 March 2003 .
[11] M. Samek, "Who Moved My State?," 2 2018. [Online]. Available: http://www.drdobbs.com/who-moved-my-state/184401643.
[12] G. Kraszewski, "Event Driven Programming, Notifications," [Online]. Available: http://krashan.ppa.pl/mph/event-driven-programming-notifications. [Accessed 3 5 2019].
[13] "GLib The Main Event Loop," [Online]. Available: https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html. [Accessed 10 4 2019].
[14] "libevent – an event notification library," [Online]. Available: https://libevent.org/. [Accessed 21 4 2019].
[15] J. v. Hoof, "How EDA extends SOA and why it is important," 3 2019. [Online].
[16] M. Samek, "State Machines for Event-Driven Systems," 2 2018. [Online]. Available: https://barrgroup.com/Embedded-Systems/How-To/State-Machines-Event-Driven-Systems.
[17] M. Richards, Software Architecture Patterns, O′Reilly Media, February 2015.
[18] X. Li, "Ncurses Programming Guide," [Online]. Available: http://www.cs.ukzn.ac.za/~hughm/os/notes/ncurses.html. [Accessed 28 4 2019].
[19] P. T. Eugster, R. Guerraoui and J. Sventek, "Distributed Asynchronous Collections: Abstractions for Publish/Subscribe Interaction," ECOOP 2000: ECOOP 2000 — Object-Oriented Programming, pp. 252-276, 12 May 2000.
[20] C. Pautasso and E. Wilde, "Why is the web loosely coupled?: a multi-faceted metric for service design," WWW ′09 Proceedings of the 18th international conference on World wide web, 20 - 24 April 2009.
[21] N. Josuttis, SOA in Practice: The Art of Distributed System Design, O′Reilly, 2007.
[22] K. M. Chandy and M. Charpentier, "Towards a Theory of Events," Inaugural International Conference on Distributed Event-Based Systems, June 2007.
[23] T. Niemann, "Lex & Yacc," [Online]. Available: https://www.epaperpress.com/lexandyacc/. [Accessed 10 5 2019].
[24] O. Levina and V. Stantchev, "Realizing Event-Driven SOA," 2009 Fourth International Conference on Internet and Web Applications and Services, 12 June 2009.
[25] M. Welsh, "The Staged Event-Driven Architecture for Highly-Concurrent Server Applications," Ph.D. Qualifying Examination Proposal.
[26] 徐健智, “On the Model and System Design for Online Tabletop Games,” 國立交通大學,博士論文, 2006.
[27] "libsigc++ Callback Framework for C++," [Online]. Available: https://libsigcplusplus.github.io/libsigcplusplus/. [Accessed 21 4 2019].
指導教授 莊永裕(YungYu Zhuang) 審核日期 2019-6-26
推文 facebook   plurk   twitter   funp   google   live   udn   HD   myshare   reddit   netvibes   friend   youpush   delicious   baidu   
網路書籤 Google bookmarks   del.icio.us   hemidemi   myshare   

若有論文相關問題,請聯絡國立中央大學圖書館推廣服務組 TEL:(03)422-7151轉57407,或E-mail聯絡  - 隱私權政策聲明