liveBook · Manning

Dotted notation

As explained in Data-Oriented Programming: Reduce software complexity

Dot notation is syntax for accessing a named property or member through a dot-separated expression.

Attribute notation accesses a named property through a dot-separated expression, such as user.email. It is concise, but it depends on the data representation: generic maps may instead require key-based access such as _.get(user, "email"). section 10.2

Convenience versus flexible paths

For a class-like member, member.email feels clearer than _.get(member, "email"). Yet generic data operations can store paths as values and retrieve catalogData through ["booksByIsbn", "978-1779501127", "title"]. section 10.2 section 3.3

Listing 3.6 Retrieving the title of a book from its information path
_.get(catalogData, ["booksByIsbn", "978-1779501127", "title"])
// → "Watchmen"

See a concrete information path retrieving a book title from nested catalog data. section 3.3

How Data-Oriented Programming: Reduce software complexity covers it

How deep it goes
Defines dot notation and contrasts it with map access, but defers detailed language semantics and implementation internals.
Examples
Uses user.email, member.email, nested catalog paths, and Lodash _.get and _.at examples.
What it assumes
Assumes basic JavaScript property access and distinguishes object members from fields stored in generic maps.
What you can do after
Evaluate when concise attribute syntax or generic path-based access better fits a data representation.
How it connects
Connects property access with hash maps, classes, generic functions, information paths, and data-oriented programming.

Also explained in

Compare how 9 books explain dotted notation →

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.