We are a couple of students trying to implement a design to search for customer information in a database. When a GUI class asks any client with the last name "Jensen" whether the client class will create many objects for each client with that last name, provide all these objects to the GUI class, allow the GUI class, for example, change something or add something Anything, and then use some method in the customer class to update it in the database?
Customer class:
Surname
Email
getSurname()
setSurname()
static List getCustomerFromDb(surname, email):
Customer customer = new Customer()
customer.setSurname(surname from db)
..
..
return listOfCustomers
updateThisCustomerInDb():
//updates all fields in db
Our implementation now is that we send the ResultSet to the GUI class from the static method in the client to search for clients. And if the GUI class wants to change the field, such as email in the client, it sends a HasMap with changes to the keys and values.
300 ?
, , , , OO-, , , ( ) , , ResultSets HasMaps.
=)