数据驱动编程

在计算机编程中,数据驱动编程,是一种编程范型,在其中程序语句描述要匹配的数据,和对它需要做的处理,程序本身不定义选取数据的一序列文件操作步骤[1]。数据驱动语言的标准例子是文本处理语言sedAWK[1],在其中数据是输入流中的一序列的行,因而它们也叫面向行的语言,而模式匹配主要通过正则表达式或行号来完成。

有关范型

数据驱动编程类似于事件驱动编程,尽管它们典型的应用于不同领域,二者都被结构化为模式匹配和结果处理,并通常由主循环来实现。条件/动作模式还类似于面向方面编程点切入机制,这里当匹配了一个接合点(条件)时,执行一个通告(动作)。类似的范型也用于某些跟踪框架比如DTrace,在这里人们列出探测(probe)即指示(instrumentation)点,和在条件满足时执行的相关的动作。

适配抽象数据类型设计方法到面向对象编程,导致数据驱动设计[2]。在面向对象编程中,这种类型的设计有时被用于在构思一段软件期间定义类。

数据驱动编程语言

邮件过滤语言
  • fdm
  • maildrop
  • procmail
  • Sieve

参见

引用

  1. Stutz, Michael. . 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; Brian Wilkerson. . 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. . www.lua.org. 2017-02-03 [2018-06-05]. (原始内容存档于2018-06-02).
  4. . 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."

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.