I understand that in the Data class my find method has to do a OR search with startsWith and in the GUI I need to use a equals / equalsIgnoreCase for exact matches. For this apart from the provided find method in the Data class I have extra methods to do the exact matches fulfilling both AND and OR conditions on name and location. Is this the right approach or should I use TableRowSorter to do filtering? I find using methods more intuitive but would like to use the correct approach. From what I understand the Data class should be separate from the gui layer so having methods in the Dats class to be used in the GUI seems a not right to me.Can anyone please throw some light in this regard?
The find-method in my business service filters the records returned by the find-method of the Data class. The filtered list is returned to the GUI and displayed in the JTable.
Of course it is just another decision you have to make but using a Sorter to filter records is not a very good idea: a Sorter should be used to sort records in some kind of order.