DELAPARRA
Index
Color
NL
Category: Programming paradigms

Data as Data

Explained by Updated

What is Data as Data?

Data as Data: Data is represented with generic, transparent structures (maps, vectors) rather than custom classes with hidden behaviour. "Data as data" is the idea of representing information with plain, generic structures such as maps, lists and records, instead of custom classes that hide their contents behind methods. The Clojure community made it popular, but you see it everywhere. A JSON API response is data as data. So is a configuration array in Laravel, or an event payload sent to a queue.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Data as Data

What should you keep in mind with Data as Data?

The benefits are practical. Plain data is easy to print, log, compare, serialise and send over the network. Any function can work with it without knowing a special class. The trade-off is less protection, because a map accepts any key, including typos. Type hints, schemas or simple data transfer objects with public properties give you some of that safety back without hiding the data.

At a glance

CategoryProgramming paradigms
Explained by
Updated

More Programming paradigms terms

All terms starting with D

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.