[Bioperl-l] Factory::GenericObjectFactory

Steve Chervitz sac at bioperl.org
Fri May 16 13:31:02 EDT 2003


My initial thinking was to not having these thin implementations, in 
the interests of having fewer modules which are just minor variations 
on a theme.

But I like the idea of using the factories to enforce some degree of 
type safety, as you can do by using ObjectFactory::interface() to 
define the expected interface and calling _validate_type() in the 
type() method. (For a demo of how this works, see  what Hilmar does in 
Bio::Ontology::TermFactory::new).

So now I'm in favor of keeping these ObjectFactory subclasses and 
converting the Search::*::*Factory modules (and others?) to be 
ObjectFactory subclasses.

Steve

On Thursday, May 15, 2003, at 15:28 US/Pacific, Hilmar Lapp wrote:

> Actually, the reason I wrote that was that I wrote lots of individual 
> interface-specific factories until it finally exceeded my level of 
> painful-but-quick tolerance. I then didn't remove all the specific 
> factories, but made them very thin descendants of ObjectFactory that 
> basically set a default interface and possibly also a default type.
>
> But OTOH this is really so thin that you might just as well get rid of 
> them altogether, and if someone tells me having so many factories is 
> confusing I'll in fact do that.
>
> 	-hilmar
>
> On Thursday, May 15, 2003, at 03:11  PM, Steve Chervitz wrote:
>
>> Hilmar: Fine with me. I must have been too lost in SearchIO world to 
>> notice when you added ObjectFactory. I like the interface() method 
>> and I added it to the ObjectFactory calls you put in some of the 
>> SearchIO modules. I also changed SearchResultEventBuilder and 
>> SearchIO::fasta.pm to use ObjectFactory instead of the various 
>> Search::*::*Factory objects.
>>
>> Jason & other interested parties: What do you think about this 
>> approach? This way, we don't need the Search::*::*Factory modules. If 
>> you think this is kosher, we can make the same changes in the other 
>> SearchIO modules (FastHitEventBuilder, axt, waba).
>>
>> Steve
>>
>> On Thursday, May 15, 2003, at 01:33 US/Pacific, Hilmar Lapp wrote:
>>
>>> I removed this module as it essentially duplicates 
>>> Factory::ObjectFactory, but with a little less functionality.
>>>
>>> SteveC I guess you overlooked that such a module was already there 
>>> when you committed it. I hope you are not offended -- but 
>>> ObjectFactory was already used at a couple of places and I didn't 
>>> quite see why we need two of this sort.
>>>
>>> 	-hilmar
>>
>>
> -- 
> -------------------------------------------------------------
> Hilmar Lapp                            email: lapp at gnf.org
> GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
> -------------------------------------------------------------
>



More information about the Bioperl-l mailing list