factory function

A function whose job is to create and return new objects, often choosing or configuring the class to use.

In more detail

A generic factory typed with InstanceType returns exactly the type of the class it was given. Factories that start from nothing often need an explicit type argument.

Related terms

Taught in

References