Don't use a cannon to kill a mosquito

Filtering records before displaying to the user

When to use heavy artillery?


A cannon killing a mosquito

      One of the common functionalities of a Custom Application is to display a list of records.

      And sooner or later you will find the need to filter or sort this list.

      When that happens, one of the first solutions that comes to the Developer's mind is to create a Business Rule or even an ACL to accomplish the mission, but is this brute force really necessary?

      There is a saying that goes: Don't use a cannon to kill a mosquito. This means that we shouldn't waste heavy ammunition if the enemy is not dangerous.

      Bringing this thought into our context, if the data is not sensitive and there would be no problem if someone had access to it, we can use a simpler solution.

      A simple way to solve the problem is to specify the filter directly in the module that the user has access.

      When clicking on the module that contains the filter, the search criteria is sent to the database and the result will be the filtered list.




Back