Hi

On 2/27/07, Nicolás Lichtmaier <[EMAIL PROTECTED]> wrote:
[snip]
>
> I think that good API design here means not assuming so many things
> about the plugin behaviour. You are right about this
> "distributeScoreToOutlinks()", but IMO it should be called something
> like assignScores(). Then you could add an abstract class
> DistributingScorePlugin (implementing the interface) which overrides
> assignScores() and calls an "abstract protected" method called
> distributeScoreToOutlink().". So the code for traversing the outlinks
> would be in DistributingScorePlugin.
>
> I would need another class, called ContentBasedScorePlugin. That class
> could call an abstract protected method called calculateScore() which
> would receive the parsed data and return the score.
>
> What do you think?
>
>

I didn't understand the point of creating abstract base classes for
plugins. I am not strictly opposing it or anything, I just don't see
why it would make things simpler/more flexible. AFAICS, there is not
much an abstract base class can do but to pass the arguments of
assignScores to calculateScore/distributeScoreToOutlinks. I mean, here
is how I envision a ContentBasedScoringFilter class(or a
DistributingScoringFilter):

abstract class ContentBasedScoringFilter implements ScoringFilter {
   assignScores(args) { return calculateScore(args);  }
   protected abstract calculateScore(args);
}

Or do you have something else in mind?

-- 
Doğacan Güney
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nutch-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nutch-developers

Reply via email to