資料驅動編程

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書

在電腦編程中,資料驅動編程,是一種程式設計範式,在其中程式語句描述要匹配的資料,和對它需要做的處理,程式本身不定義選取資料的一序列檔案操作步驟[1]。資料驅動語言的標準例子是文字處理語言sedAWK[1],在其中資料是輸入流中的一序列的行,因而它們也叫面向行的語言,而模式匹配主要通過正規表示式或行號來完成。

有關範式[編輯]

資料驅動編程類似於事件驅動編程,儘管它們典型的應用於不同領域,二者都被結構化為模式匹配和結果處理,並通常由主迴圈來實現。條件/動作模式還類似於面向方面編程點切入英語pointcut機制,這裡當匹配了一個接合點英語join point(條件)時,執行一個通告英語Advice (programming)(動作)。類似的範式也用於某些跟蹤英語tracing (software)框架比如DTrace英語DTrace,在這裡人們列出探測(probe)即指示(instrumentation)點,和在條件滿足時執行的相關的動作。

適配抽象資料類型設計方法到物件導向程式設計,導致資料驅動設計[2]。在物件導向程式設計中,這種類型的設計有時被用於在構思一段軟體期間定義類。

資料驅動程式語言[編輯]

郵件過濾語言

參見[編輯]

參照[編輯]

  1. ^ 1.0 1.1 1.2 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 
  2. ^ 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. 
  3. ^ 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). 
  4. ^ Clojure. www.clojure.org. [2018-06-05]. (原始內容存檔於2018-06-05). 

外部連結[編輯]

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."