Software Engineering Asked by codeinaire on December 1, 2020
This question is not so much about how to implement a solution as I’ve already implemented a working solution, but more about how to improve how I implemented it. The implementation process of the requirements was haphazard. That was partly due to unclear requirements and partly due to an unclear preexisting partial solution by another developer.
Recently, I completed a small web app for a client that was used to filter through a list of objects. The interface allowed a user to select what to filter for in the list of objects. There was a base filter and a sub-filter that used the criteria in the base filter as well as their own.
This is what was available to filter in the base filter:
1 worked with 2,3,4 while 2 and 3 worked as OR logic and 4 worked with AND logic with 2 and 3.
The sub filter had a set number of criteria all of which worked with AND logic with 2,3,4.
The process of building it was a bit convoluted and unclear so I’m wondering if there’s a better way.
The general structure of it was:
QUESTIONS
I’m not sure if that’s enough detail but I’m wondering what’s a way to approach filtering a list of objects, broadly speaking or relating specifically to the aforementioned criteria?
I notice that the filtering logic I developed to get it working as per the requirements was a bit haphazard and it seemed I had to work it out as I wrote the code and tested if it was filtering as expected. What would be a better way of designing this beforehand instead of haphazardly creating the solution as I go?
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP