Content deleted Content added
No edit summary |
No edit summary |
||
Line 7:
=== Factory design pattern in Java ===
The Factory pattern is useful to solve a common [[problem]]: Very often you'll have to construct an [[object]], based on some [[input]], and the [[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:
|