Skip to main content
1 of 2
Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683

Do I really have to make 24 use cases?

Only if everything you write is CRUD.

Refer to the diagram below:

enter image description here

Your assertion is that you will have six different entities, and 4 methods (Create, Read, Update and Delete) for each entity. But that is only true in the yellow circle in the middle of the diagram (the Entities layer). It is pointless to create 24 methods in the Use Cases layer that merely pass through CRUD calls to the Entities layer.

A Use Case is not "Add a Customer Record." A Use Case is more along the lines of "Sell an item to a customer" (which involves the entities Customers, Products, Inventory) or "Print an invoice" (which involves the same entities, in addition to Invoice Header and Invoice Line Items).

When you create Use Cases, you should be thinking about business transactions, not CRUD methods.

Further Reading
Aggregate - a cluster of domain objects that can be treated as a single unit

Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683