Live domain models => Ineffective?

Considering DDD, we abstract the database into the various models we are working on, and consider it as the repository in which our models live. Then add data layers and Service / Business layers on top of it. My question is that we create data transfer inefficiencies by creating fat models?

For example, let's say we have a system that displays an invoice for a client on the screen. Thinking about it from the point of view of OOP, we will probably end up with an object that looks something like this:

class Invoice {
    Customer _customer;
    OrderItems _orderitems;
    ShippingInfo _shippingInfo;
}

class Customer {
    string name;
    int customerID;
    Address customerAddress;
    AccountingInfo accountingInfo;
    ShoppingHistory customerHistory;
}
    (for the sake of the question/argument, 
    let say it was determined that the customer class had to 
    implement AccountingInfo and ShoppingHistory)

, ? , , (, , ..), .

customerName - . , , , , (, , , ShoppingHistory, , AccountingInfo, ..). , ?

+3
2

, , . , - .

, ( ), .

( ) .

+1

: " , AccountingInfo ShoppingHistory", - , ( "", ? -).

, ( ) - , , - ( ) , , .

, " " - , , , , , .

0

Source: https://habr.com/ru/post/1712941/


All Articles