commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [LANG] New class called StringAlgorithms?
Date Wed, 15 Jan 2014 18:20:47 GMT
On Wed, Jan 15, 2014 at 12:27 PM, Benedikt Ritter <britter@apache.org>wrote:

> 2014/1/15 dbrosius <dbrosius@baybroadband.net>
>
> > Invariably people will want a method signature that takes an algorithm
> > enum as a parameter so it need not be statically selected
> >
>
> I'm not sure I agree here. The more parameters a method has the less easy
> it is to understand. I don't really see a use case were an application
> decides dynamically which algorithm to use to calculate the distance
> between two strings.


If you have one class per algo, the algo name does not need to be in the
API.

G


> Do you have such a use case?


> Benedikt
>
>
> >
> > -------- Original message --------
> > From: Benedikt Ritter <britter@apache.org>
> > Date:01/15/2014  7:00 AM  (GMT-05:00)
> > To: Commons Developers List <dev@commons.apache.org>
> > Subject: [LANG] New class called StringAlgorithms?
> >
> > Hi all,
> >
> > we currently have StringUtils.getLevenshteinDistance. LANG-944 [1] is
> about
> > introducing a new string algorithm called Jaro Winkler Distance [2].
> Since
> > StringUtils already does a lot of things, I'm wondering if it may make
> > sense to introduce a new class that serves as a host for more string
> > algorithms to come. It would look something like:
> >
> > StringAlgorithms.levenshteinDistance(str1, str2);
> > StringAlgorithms.jaroWinklerDistance(str1, str2);
> >
> > We would deprecate StringUtils.getLevenshteinDistance and delegate to the
> > new class. It could be removed from StringUtils in the next major
> release.
> >
> > Thoughts?
> > Benedikt
> >
> > [1] https://issues.apache.org/jira/i#browse/LANG-944
> > [2] http://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance
> >
> > --
> > http://people.apache.org/~britter/
> > http://www.systemoutprintln.de/
> > http://twitter.com/BenediktRitter
> > http://github.com/britter
> >
>
>
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message