Hello. My assignment says:
[The GUI] must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.
So I am wondering which kind of interface to implement.
1.
2.
3.
4.
5.
1 and 2 require a client to send a Map pairing a key (field name) to its value. The second version lacks
getAllRooms as it is somewhat redundant (passing an empty Set would mean the same as calling this method).
The main advantage of this approach is that it allows adding new searching
patterns easily.
A drawback: its more complicated to implement.
3, 4, and 5 try to do this differently. The requirements ask for search by name/location so it is all the interfaces do. No more. There are some variants but the main idea is the same.
An advantage: easy to implement
A drawback: adding new search criterias would require to add new methods
What is the best? Well, I don't ask you to tell me what to choose.
I just want to know if implementing 3, 4 or 5 could cause me to lose some points (as being hard to modify).