liveBook · Manning

Transformation

As explained in The Art of Code

Transformation is a narrative plot for business logic that centers on converting data or state from one form into another.

Transformation is a narrative plot for business logic: raw, incomplete, or overlooked data becomes a more valuable form through refinement, filtering, enrichment, aggregation, or context-sensitive adjustment. section 2.1.5

Common transformation tasks include:

  • Enriching user data with external information, such as deriving geolocation from an IP address. section 2.1.5
  • Filtering invalid, corrupted, or duplicate records. section 2.1.5
  • Aggregating raw sensor readings into daily averages or usage anomalies. section 2.1.5
  • Adjusting behavior automatically according to context, such as setting temperature based on weather. section 2.1.5

Mapping a book format to a promotion

A direct transformation maps each book format to a promotional message: digital books produce a download link, while pocket and hardcover books receive their corresponding messages. Because this behavior belongs to an editor’s context and may change with campaigns or regions, it stays outside the book domain model. section 5.1

Exercise: transform a list of people

Given Person objects with names and ages, extract one youngest name, one oldest name, and an alphabetical list of all names. Rework the solution for performance, memory usage, functional programming with one pipeline, and finally maximum readability. section 10.2.1

Transformation is challenging because complexity must remain clear and simple while performance stays adequate. Naming the plot helps organize the logic and reduce the reader’s cognitive load. section 2.1.5 section 2.6

How The Art of Code covers it

How deep it goes
Defines the plot and illustrates mappings and refinements, but stops short of detailed implementation techniques.
Examples
Uses data enrichment, record filtering, sensor aggregation, book-format messages, and constrained Person-list solutions.
What it assumes
Assumes familiarity with business logic and basic collections while developing judgment about clarity, performance, memory, and programming paradigm.
What you can do after
Apply it to organize direct mappings, data-refinement tasks, and alternative solutions under design constraints.
How it connects
Connects transformation with narrative code, expressiveness, domain modeling, and context-specific behavior.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Art of Code. The section links point to the parts of the book it draws on.