|What is the best way to structure class objects in a program that allows me to search for values from different properties of the class?
I am making an application that holds client name, address phone and note information. I created a Client class that holds all these together. In my main program, I was putting each new client in an array list, but I ran across a problem. I can't search my array list for just a first or last name.
I don't think that overriding the Equals function of my class would allow me to change that, so I started looking at other ways to hold my data.
If I created another value in my class, like an ID field, I could create a hash table that was a ID/value pair (ID/First Name, ID/Last Name, ID/Address, ect). This would allow me to search each hash table and find the ID to get the full record, but that would mean I would need a table for each field that I would want to search. At this point, I'm a bit stuck on the best way to set my data structure up.
If there's some articles that give some guidance and suggestions, I would appreciate it. I can't seem to find anything because I don't think I'm using the right terminology.