Accessor: meaning, definitions and examples
🔑
accessor
[ ˈæksɛsər ]
programming, technology
An accessor is a method or function that retrieves the value of an object's property without modifying it. Accessors are commonly used in object-oriented programming to encapsulate data while providing a way to access that data safely. They help maintain the integrity of the object by controlling how properties are accessed.
Synonyms
access method, getter, retriever
Examples of usage
- The getter method serves as an accessor for the private variable.
- Using accessors can improve code readability and maintainability.
- Each property of the class has its own accessor method.
Translations
Translations of the word "accessor" in other languages:
🇵🇹 acessório
- acessador
- acesso
🇮🇳 एक्सेसर
- पहुँचने वाला
- पहुंचाने वाला
🇩🇪 Zugriffsmodul
- Zubehör
- Zugriff
🇮🇩 aksesori
- pengakses
- akses
🇺🇦 доступник
- аксесуар
- доступ
🇵🇱 akcesorium
- dostęp
- akcesor
🇯🇵 アクセサリー
- アクセス
- アクセサ
🇫🇷 accessoire
- accès
- accesseur
🇪🇸 accesorio
- acceso
- accesador
🇹🇷 aksesuar
- erişim
- eriştirici
🇰🇷 액세서리
- 접근
- 접근자
🇸🇦 ملحق
- وصول
- موصل
🇨🇿 příslušenství
- přístup
- přístupník
🇸🇰 príslušenstvo
- prístup
- prístupový
🇨🇳 配件
- 访问
- 访问者
🇸🇮 pripomoček
- dostop
- dostopnik
🇮🇸 auka
- aðgangur
- aðgangsmaður
🇰🇿 аксессуар
- қолжетімділік
- қолжеткізуші
🇬🇪 аксესუარი
- წვდომა
- წვდომის
🇦🇿 aksessuar
- giriş
- girişçi
🇲🇽 accesorio
- acceso
- accesador
Etymology
The term 'accessor' originates from the word 'access,' which comes from the Latin 'accessus,' meaning 'a coming to' or 'approach.' The root 'ac-' means toward, and 'cedere' means to go. In a programming context, the term began to be used in the late 20th century as object-oriented programming gained popularity. Accessor methods were introduced as part of encapsulation principles, allowing developers to control how properties of an object can be accessed and modified. Over time, the use of accessors became a common practice in software development, promoting better design patterns and enhancing code maintainability.