[Biococoa-dev] Factories

Alexander Griekspoor mek at mekentosj.com
Mon Aug 30 01:51:56 EDT 2004


> Every time an amino acid representation is not present, initAminoAcids 
> gets called and makes a representation for each amino acid. This just 
> appeared redundant to me. So I started to read some more, and found 
> that the combination of Singleton/Flyweight/Factory patterns is a 
> widely used approach in OOP, especially when you deal with a large 
> amount of similar objects.

Yep, the trick here is that you assure that whichever of the aminoacids 
is asked for first, all of them are created at once, and this will not 
be called again.

*********************************************************
                     ** Alexander Griekspoor **
*********************************************************
              The Netherlands Cancer Institute
              Department of Tumorbiology (H4)
         Plesmanlaan 121, 1066 CX, Amsterdam
                    Tel:  + 31 20 - 512 2023
                    Fax:  + 31 20 - 512 2029
                   AIM: mekentosj at mac.com
                    E-mail: a.griekspoor at nki.nl
                Web: http://www.mekentosj.com

	Claiming that the Macintosh is inferior to Windows
	because most people use Windows, is like saying
	that all other restaurants serve food that is
	inferior to McDonalds

*********************************************************




More information about the Biococoa-dev mailing list