liveBook · Manning

Method invocation

A method invocation is an operation that calls a method or callable operation, optionally with a receiver and arguments, causing its behavior to execute.

How 2 Manning books explain it

Kotlin in Action, 2E

The invoke method is a Kotlin function named invoke that enables instances of its containing type to be called with function-call syntax.

How it is used
Enables callable custom objects and flexible nested DSL syntax alongside ordinary method-call APIs.
How deep it goes
Explains call-syntax translation, overloads, FunctionN mechanics, nullable calls, reflection, and receiver-lambda DSL implementation.
Examples
Demonstrates a Greeter callable object, nullable transform callback, typed reflected sum function, and dependency-configuration DSL.
What you can do after
Build it from scratch by defining operator invoke methods that provide function-like calls or receiver-lambda DSL blocks.

Read how Kotlin in Action, 2E explains method invocation →

Troubleshooting Java, Second Edition

A method invocation is an execution-time call to a method, including each occurrence of entering that method.

How it is used
Uses invocation counts during performance investigations to distinguish slow methods from methods that are called excessively.
How deep it goes
Measures execution counts through filtered profiling, stopping short of explaining method implementation internals.
Examples
Compares 1,000 calls taking 50 milliseconds each with one call causing five seconds of latency.
What you can do after
Diagnose performance by filtering profiler targets and interpreting invocation counts alongside execution time.

Read how Troubleshooting Java, Second Edition explains method invocation →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.