Skip to content

Passive data structure

In computer science and object-oriented programming, a passive data structure (PDS, also termed a plain old data structure, or plain old data, POD), is a term for a record, to contrast with objects. It is a data structure that is represented only as passive collections of field values (instance variables), without using object-oriented features.

后期补充

20181118

今天在看这篇文章的时候,其中的一段话提及了passive object,非常有启示作用:

An operating system process is "alive" (has an execution context), which means that it can perform actions. The TTY driver is not alive; in object oriented terminology, the TTY driver is a passive object. It has some data fields and some methods, but the only way it can actually do something is when one of its methods gets called from the context of a process or a kernel interrupt handler. The line discipline is likewise a passive entity.