Hi all, I have a bit problem with find method in URLyBird. the interface written like this :
but in the User Interface criteria is written like this:
See the differents? in the interface, the word "Fred" matches with the word "Freddy", but in the User Interface section wants me to search where the name and/or location fields EXACTLY match values. It means "Fred" match "Fred" but not match "Freddy"
what should I do? Do I have create an private adapter method ? Or do I have to choose only one? Or what? Thanks for the answer.
I see no problem with those specifications, as they are for 2 completely separate parts of the deliverable.
Data access deliverable
Completely data agnostic. Designed to be as flexible as possible for potential reuse.
You happen to be planning on using your Data class with data that matches Hotel reservations. But as long as the schema matches, there is no reason why the same Data class could not be used for Client data, or Contractor information, etc.
For this reason, it makes sense for the methods in the Data class to be as flexible as possible. The read method returns an array of Strings, not an URLyBird data access object. The update method will allow you to update any field, not just the customer number field. And the find method searches in any field for the widest possible matches, which allows desired restrictions to be implemented where they make sense: in the business methods.
End user application
Once you are working within the client GUI, it makes sense to deal in terms of known data. So at this point you know that you are dealing with Hotel reservation data, not Clients, Contractors, or any other type of data.
So your client GUI is going to be very specific in what it allows. You do not allow updates on any field - only on the field that stores the customer number. You do not allow creates or deletes of records. And the find method used by the client GUI (which is not the find method on the server (although it uses it)) restricts to an exact match. Did that make sense?
Personally I suspect the reason this keeps coming up is because the entire specification has been delivered in a single document for a single developer to work on. In an ideal business environment this is less likely to happen: you might only be given the Data class to work on, while another person is working on the server, and yet another person is working on the GUI. Or you might still work on all the parts, but they would be handed to you piece by piece - so this month you develop the Data class, next month you are given the specifications for the server, the following month the specifications for the GUI.
Hmmm. Perhaps this should go in the JavaRanch SCJD FAQ