資料驅動編程
維基百科,自由的 encyclopedia
在電腦編程中,資料驅動編程,是一種程式設計範式,在其中程式語句描述要匹配的資料,和對它需要做的處理,程式本身不定義選取資料的一序列檔案操作步驟[1]。資料驅動語言的標準例子是文字處理語言sed和AWK[1],在其中資料是輸入流中的一序列的行,因而它們也叫面向行的語言,而模式匹配主要通過正規表示式或行號來完成。
有關範式
資料驅動編程類似於事件驅動編程,儘管它們典型的應用於不同領域,二者都被結構化為模式匹配和結果處理,並通常由主迴圈來實現。條件/動作模式還類似於面向方面編程的點切入(英語:pointcut)機制,這裡當匹配了一個接合點(英語:join point)(條件)時,執行一個通告(英語:Advice (programming))(動作)。類似的範式也用於某些跟蹤(英語:tracing (software))框架比如DTrace(英語:DTrace),在這裡人們列出探測(probe)即指示(instrumentation)點,和在條件滿足時執行的相關的動作。
適配抽象資料類型設計方法到物件導向程式設計,導致資料驅動設計[2]。在物件導向程式設計中,這種類型的設計有時被用於在構思一段軟體期間定義類。
資料驅動程式語言
- 郵件過濾語言
- fdm(英語:fdm (software))
- maildrop(英語:maildrop)
- procmail
- Sieve(英語:Sieve (mail filtering language))
參見
- 事件驅動編程
- 面向資料設計(英語:Data-oriented design)
參照
- Stutz, Michael. Get started with GAWK: AWK language fundamentals. developerWorks. IBM. September 19, 2006 [2010-10-23]. (原始內容存檔於20 May 2011).
[AWK is] often called a data-driven language -- the program statements describe the input data to match and process rather than a sequence of program steps
- Rebecca Wirfs-Brock(英語:Rebecca Wirfs-Brock); Brian Wilkerson. Object-oriented design: a responsibility-driven approach. Conference Proceedings on Object-Oriented Programming Systems, Languages and Applications (New York: ACM). 1989: 71–75. ISBN 0897913337. S2CID 7372657. doi:10.1145/74877.74885.
- Ierusalimschy, Roberto; de Figueiredo, Luiz Henrique; Celes, Waldemar. Lua 5.3 Reference Manual. www.lua.org. 2017-02-03 [2018-06-05]. (原始內容存檔於2018-06-02).
外部連結
https://homepage.cs.uri.edu/~thenry/resources/unix_art/ch09s01.html (頁面存檔備份,存於網際網路檔案館) "The important part is moving program logic away from hardwired control structures and into data."