Approach 1 - sequential approach

Let's consider three services--CustomerInformationService, MailService, and EmailService, which can provide the capabilities listed earlier. We can create NewCustomerService with the following steps:

  1. Call CustomerInformationService to save customer information to the database.
  2. Call MailService to mail the welcome kit.
  3. Call EmailService to send the e-mail notification.

NewCustomerService becomes the central place for all business logic. Imagine if we have to do more things when a new customer is created. All that logic would start accumulating and bloating up NewCustomerService.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset