Development of General extensible filters (background process gains) Pay source code, filter source code
Demo source code
Background
FilterRefers toRaw data setMediumFilterOutputMeet RequirementsOfData subset.
The filtering requirements in actual production are summarized in the following aspects:
The purpose of this article is to build a general filtering framework. This framework:
Process
Next, we will design an example to show you how to use it and provide a valuable role.
Assume there is a string: "123", "246", "B", "15", "16", "a32 ", we need to take out a group of substrings in this group of strings, which must meet the following requirements:
- If the original string list exists, take an integer of no less than 3.
- If the original string list exists, take two integers that contain 1.
According to the above requirements, the running result of our framework should be: "123", "15"
To analyze the above requirements, we need to build a custom filter using the following steps:
Gains
Abstract The common part, so that developers only focus on the business is a necessary factor in the existence of the framework. The filtering scheme proposed in this article is highly scalable. If you are interested, you can download the demo study.