Jump to content

Factory method

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 202.123.15.36 (talk) at 17:09, 2 April 2004. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

this is a static method of a class that produces an object.

it is used when the class knows more about the object than the client programmer.

also often in classes that have factory methods, are those who do have private constructor(s) and other initialisation occur before the object is produce.