liveBook · Manning

Abstraction

As explained in Build High Value Software Systems

A software-design technique that hides implementation details behind a simplified model or interface.

In spec-driven implementation, an abstraction layer is unnecessary when it adds indirection without meeting a stated requirement. Extra structure can shift attention from behavior to architecture and make code harder to review. section 3.3.2 section 4.5.4

Before keeping an abstraction, ask:

  • Does the specification require it, or does it solve a demonstrated need? section 4.5.4
  • Does it clarify required behavior, or add structure reviewers must reason about? section 3.3.2
  • Could the feature be rewritten from its specification simply? If not, identify what unnecessary complexity remains. section 4.5.4
Listing 3.4 Abstraction-centric code
export class OrderService {
  constructor(
    private db: Database,
    private cache: CacheService,
    private validator: ValidationService
  ) {}
 
  async validate(order: Order): Promise<ValidationResult> { /* ... */ }
  async calculateTotals(order: Order): Promise<OrderTotals> {
    const tax = subtotal * 0.10; // Invented 10% tax rate
    // ...
  }
  async getById(id: string): Promise<Order | null> {
    const cached = await this.cache.get(`order:${id}`);
    // ...
  }
}

The order-service example shows how caching, validation, and invented business logic can accumulate around a requested feature. section 3.3.2

How Build High Value Software Systems covers it

How deep it goes
Distinguishes unnecessary layers from required behavior and gives a specification-based deletion heuristic.
Examples
Illustrates an order service with caching, validation, and invented tax logic.
What it assumes
Assumes a feature specification against which code and abstractions can be checked.
What you can do after
Apply specification-based questions to identify and remove abstractions that add no required value.
How it connects
Connects abstraction layers with feature specifications, code review, and AI-generated code.

Also explained in

Compare how 24 books explain abstraction →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build High Value Software Systems. The section links point to the parts of the book it draws on.