bcgsc / btl_bloomfilter

The BTL C/C++ Common bloom filters for bioinformatics projects, as well as any APIs created for other programming languages.
GNU General Public License v3.0
18 stars 4 forks source link

Create a decoupled Bloom filter from hash functions #3

Closed JustinChu closed 5 years ago

JustinChu commented 7 years ago

We should have a superclass bloom filter that is agnostic of the hash functions used, where all contains and insert functions expect only a set of hash functions. This will help modularize the code between projects.

There should be subclasses which inherit from it that we can use for the swig/perl version of the code that will have insert and contains functions that can accept the actual key they are expecting.

@benvvalk any input on this?

benvvalk commented 7 years ago

I agree 100%. Having the ntHash tightly coupled with the Bloom filter is bad design, IMO. It makes it more difficult to upgrade to newer versions of ntHash or to use alternate hash functions. It also makes the code more complicated and harder to maintain.

The new generic Bloom filter class could be either a base (parent) class of the existing Bloom filter or a separate class that supports a subset of the existing Bloom filter methods. Either option would be fine by me.