[Bioperl-l] Bio::Tools::HMMER refactoring

Ewan Birney birney@ebi.ac.uk
Mon, 18 Dec 2000 09:25:56 +0000 (GMT)


Re: Bio::SeqAnalysisParserI


I can live with this interface now explained. It is actually reminiscent
of the Ensembl pipeline "Runnable" system, although the Runnable system
encapsulates the actual running of the program.


I do think though that we are making life more complex for the
implementators of the interface and the clients. I can imagine the
following scenario:


$new_analysis = yadda-yadda

$new_analysis->parse(-fh => \*INPUT);

&complex_process_results($new_analysis);


sub complex_process_results {
    $ana = shift;


    while( $next_feature = $ana->next_feature  ) {

     ... lots of stuff  ...

    # stupidly the client reuses the new analysis for a 
    # new analysis, maybe because it needs the parameterisation
    # made from the first one...

    $ana->parse(\*NEW_INPUT);

   # yikes - hard bug to catch back at while lop
}

In addition, this interface will not go easily into a corba
/time-sliced/threaded framework.


Why not have


  Bio::SeqAnalysisParserFactoryI

  $parser = $factory->create_parser(-fh => \*FILE);


  Bio::SeqAnalyisParserI

  while( $next_feature = $parser->next_feature ) {

  }


same number of functions defined. Twice the number of interfaces, but
these are the interfaces I would argue we want.


An implementation could implement ParserFactoryI and ParserI in the same
module if so wished.



Whaddya reckon? Too complex for your taste hilmar?




-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>. 
-----------------------------------------------------------------