• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Determining required fields flexibly

 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone suggest a design by which one can easily determine which fields are to be shown part of the search criteria. In other words, our requirement says we should allow search by Dest airport/Arrival airport. I would have to hard code the program to use these fields as part of the criteria for search. How can one avoid this? It is possible to have a properties file and read from that as to which fields are to be shown. However, that would be over kill. Cannot think of any other way to keep this flexible. Any suggestions would be welcome....
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had only 3 fields as searchable. Airline, Arrival and Destination. I do have thing coded specificcal. For instance in my DataAccessFacade, I have three public methods for getting the unique values of Airlines in the database into a String array added "Any Airline" as the first element, and populate a JCombobox with that data.
If they wanted to add more searchable fields, I would have to add more methods. Not the best but OK for the assignment.
I am sure there is probably a good way to dynamically create this, but I didn't want to take all that time
Mark
 
Daniela Ch
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AHAAAAN!!!
so Mark you hardcoded "Destination airport" somewhere in your code...
hein? you did hein? you did you did!!
I am starting to doubt in my capacities!!!
Come on tell us if you did!!!
/Daniela!!
[ December 25, 2002: Message edited by: Daniela Ch ]
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kalichar Rangantittu:
Could anyone suggest a design by which one can easily determine which fields are to be shown part of the search criteria. In other words, our requirement says we should allow search by Dest airport/Arrival airport. I would have to hard code the program to use these fields as part of the criteria for search. How can one avoid this? It is possible to have a properties file and read from that as to which fields are to be shown. However, that would be over kill. Cannot think of any other way to keep this flexible. Any suggestions would be welcome....

In my design, you can search by any two criteria. There are two selection menus, you pick two criteria, then hit ok, then a window come up, you type in data in edit field, hit ok again, the search result will be returned to you.
It may be overkill, but you never know, perhaps you underkill somewhere.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In application specific classes you can specify certain things, like I need to fill in my drop downs, So I have three methods one for each drop down.
Since the my Facade is Application specific, that is where I have those methods.
Mark
 
Daniela Ch
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Mark
ps: why did you cut the trees in front of the house?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the house looked covered up, and we wanted to paint the trim of the house. By removing the trees, which by the way were very troublesome to maintain, made it easier to access the windows to paint. I think it makes the house look brighter and more inviting.
Mark
 
Daniela Ch
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thats true, plus you can now put flowers under the windows...
/Daniela
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic