知识卡片
标注意图需要验证
注解或属性可以声明类的预期角色,但标签本身不会确保正确使用。将角色声明与依赖规则结合,例如限定只有具有事务标注的类才能依赖特定实体管理器,才把意图转为可检查条件。检查应覆盖真正的约束对象,不能靠命名猜行为。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 标注意图需要验证
原书出处 · 1 处
- Automating Architectural Governance · 查看原书依据
A common way architects indicate intent in supported platforms is through tagging annotations (or attributes, depending on your platform). For example, an architect may intend for a particular class to only act as an orchestrater for other services—the intent is that it never takes on nonorchestration behavior. Using an annotation allows the architect to verify intent and correct usage.
参考来源
- 位置:《Building Evolutionary Architectures Automated Software Governance, 2nd Edition》第04章《Automating Architectural Governance》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Building Evolutionary Architectures Automated Software Governance, 2nd Edition/_epub-src/OEBPS/ch04.html;段落定位:Using an annotation allows the architect)
- 结论依据:原文对“标注意图需要验证”的定义或案例,支撑“注解或属性可以声明类的预期角色,但标签本身不会确保正确使用”的归纳。据其上下文,将角色声明与依赖规则结合,例如限定只有具有事务标注的类才能依赖特定实体管理器,才把意图转为可检查条件。
- 原始内容:A common way architects indicate intent in supported platforms is through tagging annotations (or attributes, depending on your platform). For example, an architect may intend for a particular class to only act as an orchestrater for other services—the intent is that it never takes on nonorchestration behavior. Using an annotation allows the architect to verify intent and correct usage.