Should I design JSF page bean invoke multiple facade or single facade to interact with multiple modules within the system?
<p>I am reading the codes of a system and trying to understand the service layer design.</p>

<p>I observed that for every object(entity to be saved to the database), a set of related classes/implementations will be created as follow:</p>

<ol>
<li>Product.java</li>
<li>ProductDAO.java (Interface class)</li>
<li>ProductDAOImpl.java</li>
<li>ProductService.java (Interface class)</li>
<li>ProductServiceImpl.java</li>
</ol>

<p>Based on a shopping cart example, for every product the customer purchased, I will have to perform the following transaction:</p>

<ol>
<li>Decrease the quantity of the product</li>
<li>Save the order </li>
<li>Create a notification record for the batch job to send an email to notify the customer</li>
</ol>

<p>How should I design/implement it?</p>

<p>Method #1 </p>

<pre><code>public class ShoppingCartPageBeanA {
   private ProductService productService;
   private OrderService orderService;
   private NotificationService notificationService;

   public void submit() {
     productService.decreaseProductTotalQuantity(product);  
     orderService.saveOrder(order);
     notificationService.saveNotification(notification);
   }
}
</code></pre>

<p>Method #2 </p>

<pre><code>public class ShoppingCartPageBeanB {
   private ShoppingCartService shoppingCartService;

   public void submit() {
     shoppingCartService.saveOrder(order);
   }
}

public class ShoppingCartServiceImpl {

  private ProductDAO productDAO;
  private OrderDAO orderDAO;
  private NotificationDAO notificationDAO;

  public void saveOrder(Order order) {
        productDAO.decreaseProductTotalQuantity(order.getProduct);
        orderDAO.saveOrder(order);
        notificationDAO.saveNotification(order.getNotification);
  }

}
</code></pre>