Passive data structure
Plain Old Data Structures (PODS) are data structures that are represented only as passive collections of field values, without using encapsulation or other object-oriented features.
Plain Old Data Structures in C++ would not contain any member functions and would not use inheritance. They would most naturally be represented as structs. The compiler can implement assignment, copying, and field access operations on PODS very simply, with pure machine move instructions. The programmer can also copy them with low-level memory operations such as memcpy. It is common practice to set PODS in C++ to zero with memset, but technically the C++ standard does not guarantee that this will have the expected result.
In certain contexts, C++ allows only PODS to be used. For example, a union in C++ cannot contain a class that has virtual functions, or nontrivial constructors or destructors. This restriction is imposed because the compiler cannot know which constructor or destructor should be called for a union. PODS can also be used for interfacing with C, which supports only PODS.
For template-based classes in C++, it is sometimes appropriate to provide a template specialization for a PODS class that can implement moving or copying more efficiently. See Modern C Plus Plus Design.
In Java, some developers consider that the corresponding concept would be a class with public data members and no methods. Others would use a class that has methods but only getters and setters, with no logic. Java Beans fall under the PODS concept if they do not use event handling, and do not implement additional methods beyond getters and setters.
Plain Old Data Structures are often found at the boundaries of a system, where information is being moved to and from other systems or persistent storage, and the business logic that is found in other parts of the system is not relevant. For example, PODS would be convenient for representing the field values of objects that are being constructed from external data, in a part of the system where the semantic checks and interpretations needed for true objects have not yet been applied.
Other structured data representations such as XML can also be used as PODS if no significant semantic restrictions are used.