[FRPythoneers] Class factory

Evelyn Mitchell efm at tummy.com
Thu Mar 28 11:21:25 MST 2002

* On 2002-03-28 18:00 Bob Gailer <ramrom at earthling.net> wrote:
> Learning Python, p179, describes how to implement class factories in 
> Python, but gives no explanation as to what a factory is good for or why 
> one would want to do that. Since I have no background in factories it 
> leaves me in the dark.
> So - what are class factories good for? Where can I find a non-trivial example?

Factories are an instance of a Pattern. Patterns are shorthand ways of
describing common methods of constructing software, just as 'dovetail
joint' is a shorthand way of describing a method in woodworking.

The idea of patterns has been around a while. It gained popularity with the
book _Design Patterns_ by Gamma, Helm, Johnson and Vlissides (who are known
as the Gang of Four or GoF). 

A good online source for more information about Patterns is the Portland
Pattern Repository at c2.com http://www.c2.com/cgi/wiki?WelcomeVisitors

A Factory pattern describes a way of creating new objects.

Regards,                    tummy.com, ltd 
Evelyn Mitchell             Linux Consulting since 1995
efm at tummy.com               Senior System and Network Administrators

More information about the FRPythoneers mailing list