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
Editor

Margaret jest nagradzaną technical writerką, nauczycielką i wykładowczynią. Jest znana z tego, że potrafi w prostych słowach pzybliżyć złożone pojęcia techniczne słuchaczom ze świata biznesu. Od dwudziestu lat jej definicje pojęć z dziedziny IT są publikowane przez Que w encyklopedii terminów technologicznych, a także cytowane w artykułach ukazujących się w New York Times, w magazynie Time, USA Today, ZDNet, a także w magazynach PC i Discovery. Margaret dołączyła do zespołu Techopedii w roku 2011. Margaret lubi pomagać znaleźć wspólny język specjalistom ze świata biznesu i IT. W swojej pracy, jak sama mówi, buduje mosty między tymi dwiema domenami, w ten…