Accessor

Why Trust Techopedia

What Does Accessor Mean?

In computer programming, an accessor method is a method that fetches private data that is stored within an object. An accessor provides the means by which to obtain the state of an object from other program parts. This is a preferred method in object-oriented paradigms as it provides an abstraction layer that hides the implementation details of functionality sets.

Advertisements

Techopedia Explains Accessor

While a new dependent code is contained within accessor methods, they do directly access state data. Also, within a database fetch, the dependent code doesn’t need to be changed. This is an advantage of this type of object-oriented programming.

When comparing two data items, two access method calls are necessary in order to make the comparison. Accessors seek underlying data such as data creation, data retrieval, initialization, retrieval and modification. The accessor method is a type of instance method that contains a sequence of programming statements for the purpose of performing an action, customizing those actions with a parameter and producing a return value of some sort.

Advertisements

Related Terms

Margaret Rouse
Technology expert
Margaret Rouse
Technology expert

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.