As introduced earlier, the project design starts with listing general entities, such as users, products, and warehouses when designing an e-commerce platform:
![](https://static.packt-cdn.com/products/9781838552657/graphics/assets/b8991f30-493e-4e8f-84d7-02f1b58ed92e.png)
We then decompose each entity into smaller components. To make things clearer, consider each entity as a separate class. When thinking of an entity as a class, it makes more sense in terms of decomposition. For example, we express the user entity as a class:
class User
{
public:
// constructors and assignment operators are omitted for code brevity
void set_name(const std::string& name);
std::string get_name() const;
void set_email(const std::string&);
std::string get_email() const;
// more setters and getters are omitted for code brevity
private:
std::string name_;
std::string email_;
Address address_;
int age;
};
The class diagram for the User class is the following:
![](https://static.packt-cdn.com/products/9781838552657/graphics/assets/bd7b14fe-6cee-47bd-be57-e54cd658200b.png)
However...