Structured Data Programming

combines advantages  and eliminates disadvantages of the two software design concepts

Data stored as an internal data structure

Advantages: Ultimate speed. Unlimited data complexity. 

Disadvantages: Size of the data is limited by the computing device. Pointer/reference based data structures are difficult to debug. Existing C++ templates and Java generics cannot not support bi-directional data structures. Custom data storage (serialization) is expensive to design, error prone, and inflexible to support changes of the data model.

Data stored in a database

Advantages: Ready to use safe storage, backup. Easy handling of larger data. Data compatibility with other programs. High adaptability to changes (schema migration).

Disadvantages: Slow speed and often larger data footprint. Data complexity restricted to a given model. Overhead of the conversion between the database model and the internal data structures. 

Structured Data Programming

Advantages: Ultimate speed and unlimited data complexity of internal data structures. User control over paging of large data. No need of data conversion. Small data footprint. Data structures implemented transparently as if describing database schema. All pointer/reference problems debugged in a safe, generic library. Automatic data storage much efficient when using a database. Can support schema migration.

Disadvantages: New programming paradigm. Programs sharing the data must share the data schema. Expanding existing templates/generics by a simple feature similar to static aspects. 

How is this implemented

We remove declarations of data structures from the classes where they are now buried, and move them into a block of statements resembling a database schema. Transparently, this schema invokes the data structures from a special library. Because all pointers/references implementing the data structures are transparent to the application code, the library can also provide automatic data storage (serialization). Until languages like C++ or Java support the more general templates, a simple code generator expands them for you.

Technical details

All technical details and programming tricks for several different styles of implementation of Structured Data Programming are described in the book by Serialization and Persistent Objects - Turning Data Structures into Efficient Databases. Note that this book was published before the term Structured Data Programming was introduced. Also note that the book also describes the Organized C implementation suitable for iPhone applications.