Pattern, Abstract Factory / Factory

Scott McKay swmckay at gmail.com
Sat Feb 6 15:40:23 UTC 2021


Thank you for sending this. I had just started, so look at the time you saved me!

—Scott

> On Feb 6, 2021, at 10:17 AM, Luís Oliveira <luismbo at gmail.com> wrote:
> 
> On Sat, 6 Feb 2021 at 13:46, Manfred Bergmann <manfred.bergmann at me.com> wrote:
>> Does anyone know what Peter Norvig had in mind when he said that metaclasses can be used instead of Abstract Factory pattern?
> 
> Are you talking about slides 12 and 13? Peter does not mention
> metaclasses there or anywhere else in his slides. I believe his point
> is that make-instance is the factory. Classes are first-class values
> and make-instance accepts a class as its first argument. If you use
> qt-backend, gtk-backend, motif-backend classes, at some point you can
> make the decision about which class to instantiate and pass it to
> make-instance. He categorizes this pattern as invisible, which might
> explain why you're having trouble seeing it. :-)
> 
> Cheers,
> Luís
> 



More information about the pro mailing list