Factory method pattern: Difference between revisions

Content deleted Content added
rm non-subjective links
Robbot (talk | contribs)
m Andre Engels - Robot-assisted disambiguation: Function
Line 3:
=== Factory design pattern in Java ===
 
The Factory pattern is useful to solve a common problem: Very often you'll have to construct an [[Object (computer science)|object]], based on some [[input]], and the [[function (programming)|function]]s inside the object will depend upon the input. A good example would be a [[class (computer science)|class]] to read [[image file]]s and make [[thumbnail]]s out of them. You could, of course, bung them all into one class and have it decide which bit of code to run on its own: