liveBook · Manning

Data entity

As explained in Data-Oriented Programming: Reduce software complexity

A data entity is an entity representing stored or modeled information independently of the code that operates on it.

A data entity is a part of a system that holds information independently of the functions operating on it. In data-oriented programming, entities contain members but no code; stateless functions receive them explicitly as arguments. section 2.1 section 2.2

Start with the workplace problem: a class that mixes state, behavior, and many relationships is difficult to understand. Splitting its data from its code creates two simpler parts that can be considered separately. section 1.2.1 section 2.4

Discover and organize data entities by following a few practical moves:

  • Scan requirements for nouns and noun phrases that represent information, such as users, members, books, authors, and book copies. section 2.2
  • Group related entities into high-level areas, such as user management and catalog data. section 2.2
  • Keep relationships among entities to association and composition, while placing behavior in code modules with usage relationships. section 2.6
  • Pass entity data into stateless functions rather than hiding it as implicit object state. section 2.6

Library Management System

A catalog can hold data about books, authors, book items, and lendings; user management can hold data about users, members, and librarians. A function such as getBookLendings receives libraryData and memberId, while catalog and user-management modules perform the behavior. Adding permissions for Super members or VIP members changes functions without changing the overall data design. section 2.2 section 2.5

Figure 2.3 The data entities of the system organized in a mind map

Use the entity mind map to see how requirements become grouped information areas before code is designed. section 2.2

How Data-Oriented Programming: Reduce software complexity covers it

How deep it goes
Defines entity discovery, grouping, contents, and relationships, while deferring detailed data design refinement.
Examples
Illustrates entities with books, authors, book copies, lendings, users, members, and librarians in a library system.
What it assumes
Assumes requirements containing domain nouns but teaches entity discovery and code-data separation without requiring functional-programming concepts.
What you can do after
Build a DOP data model by extracting nouns, grouping entities, and passing their data explicitly to stateless functions.
How it connects
Connects data entities to data-oriented programming, code modules, stateless functions, data encapsulation, association, and composition.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data-Oriented Programming: Reduce software complexity. The section links point to the parts of the book it draws on.