Hi
You misunderstand what use cases are.
Writing the name of a product on a piece of paper does not make the company money. Selling it does!
Think of entities as objects encapsulating application INDEPENDENT business logic.
For example, if you take a shopping cart from one shopping app to another, there should be no reason to rewrite it. It adds/removes/holds product entities (that consist of a base class with all the common properties like SKU, name, price, etc., and subclasses to handle company specific product info), tells you how many items you have in the cart and possibly calculates the total in the cart. As such, the shopping cart is an entity.
Use cases manipulate entities and gateways to get something done, and they contain application DEPENDENT business logic. Examples of use cases would be:
Checkout - (each company has their own process)
Pay employees - (Each company pays employees differently with different schemes)
Start engine - (each company and vehicle model might have a different engine start sequence)
Create purchase order - (Each company has different ways of procurement)
As such, us cases are NOT entities (extension means "is a"). Also, Uncle Bob does not cover this in his book, but use cases come in 2 varieties:
- low level use cases - they generally get one thing done
- high level use cases - they coordinate between low level use cases to get more complex things done.
Regarding a previous question of yours that I saw, but could not reply to because the UI of this forum sucks on a phone, gateways are simply objects that shuttle entities in and out of the app. Gateway interfaces depend on entities and primitives ONLY.
That means that they will NEVER return raw database table data, or network responses, or bytes or any such nonsense. They always take and return Entities. Think about them as portals.
You have an entity (let's say employee) and you want to tell the portal "Here's an employee! Sore it!" and the portal takes your employee entity and sends it over the network, or to the disk or saves it into a database. The app should not know or care how this happens. Or you tell it "Gimme a list of Employees who satisfy condition X!" and the portal returns a list of employees fetched for a network, or disk, or DB. Again, the app does not know or care about how the portal does what it does.
Perhaps the diagram below makes it easier for you to visualize what's going on. Arrows mean a "Has a" relationship.
DB Disk Network
⭡---------⭡-----------⭡
|
Gateways Entities
⭡__________________⭡
|
Use cases
⭡
UI
Hope this helps!
Regards,
Norbert