← 返回卡片

原书出处

Domain-Driven Design Tackling Complexity in the Heart of Software

82 原书第10章|Angles of Attack

核验版本的摘录快照 · 导入于 2026-11-14T03:12:56.399Z

blic void applyPrincipalPayment(SharePie paymentShares) { setShares(shares.minus(paymentShares)); }

Each of these short methods states its meaning. Applying a principal payment means that you subtract the payment from the loan, share by share. Distributing a principal payment is done by dividing the amount pro rata among the shareholders. The design of the Share Pie has allowed us to use a declarative style in the Loan code, producing code that begins to read like a conceptual definition of the business transaction, rather than a calculation.

Other transaction types (too complicated to list before) can be declared easily now. For example, l

此预览只包含定位所需的摘录和上下文。

原书定位详情

来源:a19c7933-4eda-4176-aebd-30fe7e1ad292

正文位置:extracted/Domain-Driven Design Tackling Complexity in the Heart of Software/_epub-src/0321125215_ch10lev1sec9.html

EPUB SHA-256:3e81897e8809ae8135b32e0563f9858b3020c5f5128531655f6d8e3a21c679ce