POV-Ray : Newsgroups : povray.off-topic : The "Factory" Pattern : Re: The "Factory" Pattern Server Time
4 Sep 2024 05:17:16 EDT (-0400)
  Re: The "Factory" Pattern  
From: Fredrik Eriksson
Date: 26 Apr 2010 14:43:01
Message: <op.vbr8xzue7bxctx@toad.bredbandsbolaget.se>
On Mon, 26 Apr 2010 19:10:18 +0200, Darren New <dne### [at] sanrrcom> wrote:
> Fredrik Eriksson wrote:
>> Decentralization is not the purpose of the Factory pattern.
>
> Uh, sure it is, in the same sense that inheritance is decentralization.  
> What do *you* think it's for?  Maybe it's good for something else too.

Perhaps a poor choice of words on my part. I would say that the Factory  
pattern is about decoupling/abstraction, but I suppose you could call that  
decentralization.

My point was that the issue of having to lump information about all the  
concrete classes together in one place is orthogonal; the Factory pattern  
is not intended to decentralize that part, even if you *can* sometimes do  
it.



> Altho, I suppose with MI (so you can inherit the "Factory" methods  
> anywhere) and static library initialization (so you can invoke those  
> implicitly to do registration when the class gets loaded) you could come  
> very close to doing this with nothing but a library.

MI is not necessary -- nor even helpful -- for this.



-- 
FE


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.