DEV Community

Discussion on: Encapsulate state and expose behavior when writing object-oriented code

Collapse
 
unruledboy profile image
Wilson Chen

I don't agree on this. Customer is a merely a POCO here.

If you would really want to provide a proper encapsulation, then we would have provided TotalPurchase as public so the actual biz logic can read, use and persist.