# Represent data with generic data structures

DevFeed: [Represent data with generic data structures](<https://devfeed.tech/articles/represent-data-with-generic-data-structures-37567.md>)

Original publisher: [Read original article](<https://blog.klipse.tech/databook/2022/06/22/generic-data-structures.html>)

Author: Yehonathan Sharvit

Published: 2022-06-22T02:33:24Z

Content type: article

Language: en

Sources: [Klipse](<https://devfeed.tech/sources/klipse.md>)

Topics: [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Code](<https://devfeed.tech/topics/code.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [array](<https://devfeed.tech/tags/array.md>), [arrays](<https://devfeed.tech/tags/arrays.md>), [code](<https://devfeed.tech/tags/code.md>), [d](<https://devfeed.tech/tags/d.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [dop](<https://devfeed.tech/tags/dop.md>), [immutability](<https://devfeed.tech/tags/immutability.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [oop](<https://devfeed.tech/tags/oop.md>), [programming](<https://devfeed.tech/tags/programming.md>)

## AI overview

This article explores the second principle of Data-Oriented Programming: representing application data with generic data structures such as maps and arrays instead of specific classes. It also discusses other structures, including sets, trees, and queues, and describes benefits such as reusable generic functions and a flexible data model.

## Source excerpt

When adhering to Principle #1 of DOP, code is separated from data. DOP is not opinionated about the programming constructs to use for organizing the code, but it has a lot to say about how the data should be represented. This is the theme of Principle #2.