V2EX  ›  英汉词典

Accessor

Definition / 释义

accessor(名词):访问器;取值/存取方法。常见于编程语境,指用于读取或设置某个属性/字段的函数或方法(如 getter/setter)。在某些语境中也可泛指“取得某物的人/装置”,但最常见用法是软件开发中的术语。

Pronunciation / 发音

/əkˈsɛsər/

Examples / 例句

The class provides an accessor for the user’s name.
这个类为用户名提供了一个访问器。

To keep the object’s state consistent, the library exposes data only through accessors that validate input and trigger notifications.
为了保持对象状态一致,这个库只通过会校验输入并触发通知的访问器来暴露数据。

Etymology / 词源

access(访问、接近)+ 名词后缀 -or(表示“做某事的人/物”)构成,字面意思是“用于访问的东西/人”。现代英语里该词在计算机科学中固定化为“(属性)访问器”的技术用法。

Related Words / 相关词

Literary Works / 文学与著作例证

  • C# in Depth(Jon Skeet)——讨论属性(properties)与访问器(accessors)的实现与细节
  • The C# Programming Language(Anders Hejlsberg 等)——在语言特性章节中使用 accessor 描述属性的 get/set 访问器
  • Swift Programming Language(Apple 官方文档/书籍)——在属性(properties)与访问控制相关部分提及访问器概念(get/set)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1085 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 9ms · UTC 17:04 · PVG 01:04 · LAX 09:04 · JFK 12:04
♥ Do have faith in what you're doing.