liveBook · Manning

Explicit input

As explained in Data-Oriented Programming: Reduce software complexity

An explicit argument is a value directly supplied by the caller in a function invocation.

An explicit argument is a value supplied directly by the caller. In data-oriented programming, functions receive the data they manipulate instead of finding state through an object. section 2.3

Making library state visible

Instead of letting getBookLendings read library state through this, pass it directly: getBookLendings(libraryData, userId, memberId). The function’s dependencies are now visible in its signature. section 2.3

The design shift is small in syntax but broader in structure:

  • Object-oriented methods treat object state as an implicit argument. section 2.3
  • Data-oriented module functions remain stateless and usually receive manipulated data as their first argument. section 2.3
Listing 2.1 The signature of getBookLendings
class Library {
  static getBookLendings(libraryData, userId, memberId) {
  }
}

Inspect the Library method signature with libraryData exposed as its first argument. section 2.3

How Data-Oriented Programming: Reduce software complexity covers it

How deep it goes
Explains the contrast with implicit object state, demonstrates a method signature, and stops short of execution internals.
Examples
Uses a Library getBookLendings signature and contrasts JavaScript-style this access with Python’s self parameter.
What you can do after
Apply data-oriented programming by redesigning module functions to accept their manipulated data explicitly.
How it connects
Connects explicit arguments with implicit arguments, object state, stateless functions, modules, and data-oriented programming.

Also explained in

Compare how 2 books explain explicit input →

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.