Tuesday, March 10, 2015

Naming patterns for filtering methods

from http://martinfowler.com/articles/collection-pipeline/#op-catalog

Good naming pattern for filters as "filter" term does not not describe where required object will be - removed from collection or stay in collection:

rejectXXXXX - Inverse of filter, returning elements that do not match the predicate.

selectXXXXX - Runs a boolean function on each element and only puts those that pass into the output..

No comments:

Post a Comment