知识卡片

普通读书笔记卡 · 1971.o.1.b.1.a.2.a.3.h.1

薪酬示例说明任意放开关联无法表达政策

理解等级:高级

原书薪酬与退休金示例中,起初小时工与固定缴费计划绑定、月薪员工与确定给付计划绑定(图16.15–16.16)。政策改为办公室行政人员虽按小时计酬,却参加确定给付计划。若只删除员工与计划的约束(图16.17–16.18),保洁员也可能被随意切换,模型无法执行公司政策。

把“员工类型”显式建模,并由其限定退休计划及薪酬安排,才能在保持政策约束的同时允许授权调整(图16.19–16.20)。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 原书第16章|Knowledge Level · 查看原书依据

      This model allows each employee to be associated with either kind of retirement plan, so each office administrator can be switched. This model is rejected by management because it does not reflect company policy. Some administrators could be switched and others not. Or the janitor could be switched. Management wants a model that enforces the policy: Office administrators are hourly employees with defined-benefit retirement plans. This policy suggests that the "job title" field now represents an important domain concept. Developers could refactor to make that concept explicit as an "Employee Type.

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第131章《Knowledge Level》(源文件:_epub-src/0321125215_ch16lev1sec4.html) - 结论依据:原书示例连续比较初始模型、放开所有约束的失败方案与显式员工类型方案,图16.15–16.20已目视核对。 - 原始内容:This model allows each employee to be associated with either kind of retirement plan, so each office administrator can be switched. This model is rejected by management because it does not reflect company policy. Some administrators could be switched and others not. Or the janitor could be switched. Management wants a model that enforces the policy: Office administrators are hourly employees with defined-benefit retirement plans. This policy suggests that the "job title" field now represents an important domain concept. Developers could refactor to make that concept explicit as an "Employee Type." - 转录说明:原 EPUB 的政策要求、块引文和作者建模建议分属相邻段落,三段之间没有省去原文;术语标签边界按可读正文规范转录。