Consider the object Customer, which has two attributes customerID
and phone
, both are String
type, and some objects are already stored in a given list, where both attributes must be unique. When designing the UML diagram for atomic use case, what should I choose between the following:
addCustomer(customer: Customer)
, or
addCustomer(customerID: String, phone: String)
The precondition is to verify if the new customer does not exist in the (already given) list. If choose the former, I can use customer1.equals(customer2)
, and the latter I have to check both parameters for each Customer in the list, which is longer.
Aucun commentaire:
Enregistrer un commentaire