nutch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doğacan Güney" <>
Subject Re: Creating a new scoring filter.
Date Tue, 27 Feb 2007 19:32:03 GMT

On 2/27/07, Nicolás Lichtmaier <> wrote:
> 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

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
View raw message