daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class ServiceFacadeImpl {
  2.   public void createPortalAccount(Contact contact) {
  3.     // here the contact is implicitly saved
  4.     this.portalService.createPortalAccount(contact);
  5.   }
  6. }
  7.    
  8. class ServiceFacadeImpl {
  9.   public void createPortalAccount(Contact contact) {
  10.     // here contact is implicitly modified
  11.     this.portalService.createPortalAccount(contact);
  12.     this.contactDAO.save(contact);
  13.   }
  14. }
  15.    
  16. class ServiceFacadeImpl {
  17.   public void CreatePortalAccountAndSaveContact(Contact contact) {
  18.     try
  19.     {
  20.       contact.portalAccount = this.portalService.createPortalAccount(contact);
  21.       this.contactDAO.save(contact);
  22.     }
  23.     catch(...)
  24.     {
  25.       // do cleanup, for example do you need to delete account from remote
  26.       // portal if it couldn't be saved locally?
  27.       // If yes, delete it from portal and set contact.portalAccount = null;
  28.     }
  29.   }
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top