Plain Old Data structure

In computer science and software engineering refers to a Plain Old Data structure (POD ) is a data structure that only consists of simple attribute values ​​and in which no object-oriented principles have been applied.

Introduction

PODs are particularly used where ensuring data integrity and processing of the data is taken over by other system components. They are often used at system boundaries at which data can be exchanged between different systems or with persistent disks, and therefore where the business logic of the system involved is not directly relevant. For example, objects, which are generated from the external data, are implemented in the form of POD. Checking the semantic correctness and integrity of the data is then transferred to a further step of the other system components.

PODs in C

In C a POD data type is either a scalar data type or a POD class. A POD class has no user-defined copy assignment operator, no custom constructor and no non- static attributes that are not PODs themselves. In addition, a POD class has an aggregate type or a union be, that is, they must not have any user-defined constructors, no non- static attributes are defined as private or protected, no base classes, and no virtual functions. The C standard [ Reference 1 ] contains more details about the behavior of PODs in C .

Depending on the specific use only POD types are possible in C under certain circumstances. For example, a union in C 98 contain any classes that owns the virtual functions or non-trivial constructors or destructors. This restriction is because the compiler can not decide which constructors or destructors to be called for the elements of the union. POD types can also be used for calling C functions because C only PODs support.

PODs in Java

In Java, the POD concept is sometimes equated with a class that contains only public attributes and no methods (See Java Code Conventions 10.1), which corresponds to the concept of a transfer object. Sometimes POJOs ( classes that contain only getters and setters, but no business logic), and JavaBeans, provided they do not use event handling and no other methods included except getters and setters, referred to as PODs. On the other hand, POJOs and JavaBeans use the concept of encapsulation and, therefore, violate one of the fundamental properties of a POD data type.

More

Other structured data such as XML or JSON may also be used as PODs, if no comprehensive semantic restrictions on the data are defined.

652371
de