Last active
December 17, 2015 12:18
-
-
Save sudarshan89/5608268 to your computer and use it in GitHub Desktop.
CustomerService with a CRUD/Anemic mindset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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