知识卡片
名称与类型的共变
名称共变要求各方同意实体名称,类型共变要求同意值的类型。二者通常可在源码中识别,并能借助工具协调修改,因此优于隐藏的运行时约定。类型检查能减少部分错误,但不能保证相同类型参数的语义或位置正确。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 名称与类型的共变
原书出处 · 1 处
- Evolutionary Architecture Topologies · 查看原书依据
Names of methods represent the most common way that codebases are coupled and the most desirable, especially in light of modern refactoring tools that make system-wide name changes trivial. Connascence of Type (CoT) Multiple components must agree on the type of an entity. This type of connascence refers to the common facility in many statically typed languages to limit variables and parameters to specific types.
参考来源
- 位置:《Building Evolutionary Architectures Automated Software Governance, 2nd Edition》第05章《Evolutionary Architecture Topologies》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Building Evolutionary Architectures Automated Software Governance, 2nd Edition/_epub-src/OEBPS/ch05.html;段落定位:Names of methods represent the most common)
- 结论依据:原文对“名称与类型的共变”的定义或案例,支撑“名称共变要求各方同意实体名称,类型共变要求同意值的类型”的归纳。据其上下文,二者通常可在源码中识别,并能借助工具协调修改,因此优于隐藏的运行时约定。
- 原始内容:Names of methods represent the most common way that codebases are coupled and the most desirable, especially in light of modern refactoring tools that make system-wide name changes trivial. Connascence of Type (CoT) Multiple components must agree on the type of an entity. This type of connascence refers to the common facility in many statically typed languages to limit variables and parameters to specific types.