Git Product home page Git Product logo

Comments (4)

sweisgerber-dev avatar sweisgerber-dev commented on August 15, 2024

Implementation is done:

Need TestDevice

from artist.

schrnz avatar schrnz commented on August 15, 2024

Tbh the interface is already generic enough and this change would make it more specific imo. Instead of two, there could be any number of filters. However, this can easily be implemented by creating a new filter that instantiates multiple sub-filters, applies them in any order desired by the developer and combines their results.

The implementations of the functionality you wanted to have, i.e. combinations of whitelisting and blacklisting, are straightforward in this approach.

Example: Whitelist with a blacklist of exceptions (pseudo-code):

WhitelistFilter whitelist([sig1, sig2, ...]);
BlacklistFilter exceptions([sig1, sig4, ...]);
return whitelist.accept(method_sig) && !exceptions.accept(method_sig);

I would argue that this solution is more generic since you could implement any combination of two or more filters, so the new changes are not extending the expressiveness of the API but might introduce problems if there are less than two filters and may confuse people b/c it is not immediately clear why two filters seem to be expected.

Of course we can discuss this, but my current stance is that the API should be as generic as possible to cover a wide range of use cases, and the proposed changes feel a bit like tailoring the API towards a specific module.

I would like to hear your opinion on this @sweisgerber-dev .

from artist.

sweisgerber-dev avatar sweisgerber-dev commented on August 15, 2024

My change doesn't make the creation of two filters necessary (set one or both null), but creating a new FilterType is indeed much more elegant.

I'll apply your proposal.

from artist.

sweisgerber-dev avatar sweisgerber-dev commented on August 15, 2024

Implemented in:

from artist.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.