How should we handle the following input to criteriaFind: "Origin". The way I had my code written, it will ignore this entry and return all the flights. The instructions say "In the event of an invalid field name being provided as part of the criteria the behavior of this method is the same as if no records matched correctly specified criteria. " However, in this case, the field name is valid, but no value is entered. Do you think it should return all values or no values?
i used a combobox on the interface and loaded in all the possible values - starting with 'any' -- so there's always a value for origin and destination. as
posted 18 years ago
Originally posted by Amy Saari: i used a combobox on the interface and loaded in all the possible values - starting with 'any' -- so there's always a value for origin and destination. as
I'm not using a combo box, but I have my client ignore an entry if the string entered is empty or "ANY". So, for this application, there's no problem. I'm thinking of reuse, though, and how the method should be designed for theoretical other clients. Thanks
The protocol explicitely states the format "Origin='***',Destination='***'". Anything other than that should not be constracted by client. If something like that gets constructed and passed to the server server should ignore invalid request and return an empty set. Criteria "Origin", or "Origin=" are violations of the protocol, criteria "Origin=''" is valid but doesnt match anything so it returns no matches. I hope this helps
I knew I would regret that burrito. But this tiny ad has never caused regrets:
Devious Experiments for a Truly Passive Greenhouse!