DescriptionCommon usage of the factory method pattern.PNG
English: This UML diagram depicts what is explained in the Factory method pattern, common usage section, as I think that this section is not easily comprehendable by readers unfamiliar with programming. It shows an example for the factory method pattern that is used in test-driven development. The test uses the TestFoo instead of Foo, and creates instead of a Dangerous object only a fake object called FakeDangerous that does not hamper the test.
to share – to copy, distribute and transmit the work
to remix – to adapt the work
Under the following conditions:
attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.