DESCRIPTION

HashAlgorithm is now an interface

This is preferable over an Enum in order to allow client hash function
customization


Change-Id: I0c992186e7b7701929e0dc60341430d8d2255ba7


COMMENTS

author: Tatum Robbins
date: 2011-08-06 02:47:32.580000000

Uploaded patch set 5.

-------------------------------------
author: Tatum Robbins
date: 2011-08-06 03:14:02.538000000

Patch Set 5:

Michael,

I believe that having "defaults" like those hash algorithms in enums allows keeping things in one place. I also prefer to avoid small classes as they make code less readable. Accessing them in static way also have a convenience for those who will be updating their legacy code. Besides that, the "hash" method is stateless. Either way, it's just a matter of design and following the same conception of the "code around you in the project". 

What advantages do you see having those hash algorithms as outstanding classes? The one could be - someone would need to extend them. But I'm not sure about of purpose of that.

-------------------------------------
author: Noah Dean
date: 2011-08-06 03:20:30.314000000

Patch Set 5:

IMO, having some of them be members of an enum, but implementing an interface that other things can implement is confusing.  It's either a pre-defined finite set or it isn't.  Enums are more about type safety than avoiding types.

-------------------------------------
author: Kenny Maynard
date: 2011-08-06 04:26:34.442000000

Patch Set 5: Looks good to me, but someone else must approve

Paul,

That makes sense. I think from my point of view one of the good reasons for an interface here is that people can easily extend it. With that said, I don't think many people will do this so I am fine with the code the way it is. I just wanted to get your thoughts on why you took this approach so that in the future if someone asks why we did this the way we did I have a better understanding.

-------------------------------------
author: Noah Dean
date: 2011-08-13 01:00:14.221000000

Patch Set 5: Looks good to me, but someone else must approve

I think this looks pretty good.  I'd like to get rid of the enum altogether, but we shouldn't do that in this changeset.

It'd be nice to have a µbenchmark here, but I'd have a hard time imagining where it matters.

-------------------------------------
