Skip to content

Instantly share code, notes, and snippets.

@sudarshan89
Last active December 17, 2015 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sudarshan89/5608268 to your computer and use it in GitHub Desktop.
Save sudarshan89/5608268 to your computer and use it in GitHub Desktop.
CustomerService with a CRUD/Anemic mindset
public void saveCustomer(String customerId, String customerFirstName, String customerLastName,
String streetAddress1,String streetAddress2, String city,
String stateOrProvince, String postalCode, String country,
String homePhone, String mobilePhone, String primaryEmailAddress,
String secondaryEmailAddress) {
Customer customer = customerDao.readCustomer(customerId);
if (customer = =null)
{
customer = new Customer();
customer.setCustomerId(customerId);
}
if (customerFirstName != null) {
customer.setCustomerFirstName(customerFirstName);
}
if (customerLastName != null) {
customer.setCustomerLastName(customerLastName);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment