Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ServiceFacadeImpl {
- public void createPortalAccount(Contact contact) {
- // here the contact is implicitly saved
- this.portalService.createPortalAccount(contact);
- }
- }
- class ServiceFacadeImpl {
- public void createPortalAccount(Contact contact) {
- // here contact is implicitly modified
- this.portalService.createPortalAccount(contact);
- this.contactDAO.save(contact);
- }
- }
- class ServiceFacadeImpl {
- public void CreatePortalAccountAndSaveContact(Contact contact) {
- try
- {
- contact.portalAccount = this.portalService.createPortalAccount(contact);
- this.contactDAO.save(contact);
- }
- catch(...)
- {
- // do cleanup, for example do you need to delete account from remote
- // portal if it couldn't be saved locally?
- // If yes, delete it from portal and set contact.portalAccount = null;
- }
- }
- }
Add Comment
Please, Sign In to add comment