About: Field encapsulation     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : owl:Thing, within Data Space : dbpedia.org associated with source document(s)
QRcode icon
http://dbpedia.org/describe/?url=http%3A%2F%2Fdbpedia.org%2Fresource%2FField_encapsulation

In computer programming, field encapsulation involves providing methods that can be used to read from or write to the field rather than accessing the field directly. Sometimes these accessor methods are called getX and setX (where X is the field's name), which are also known as mutator methods. Usually the accessor methods have public visibility while the field being encapsulated is given private visibility - this allows a programmer to restrict what actions another user of the code can perform. Compare the following Java class in which the name field has not been encapsulated:

AttributesValues
rdfs:label
  • Field encapsulation (en)
  • Інкапсуляція поля (uk)
rdfs:comment
  • Інкапсуля́ція по́ля (англ. Encapsulate Field) — прийом рефакторингу, що дозволяє полегшити роботу з даними, покращити модульність частин програми та полегшити її підтримку. Забезпечує зближення даних і поведінки над цими даними. (uk)
  • In computer programming, field encapsulation involves providing methods that can be used to read from or write to the field rather than accessing the field directly. Sometimes these accessor methods are called getX and setX (where X is the field's name), which are also known as mutator methods. Usually the accessor methods have public visibility while the field being encapsulated is given private visibility - this allows a programmer to restrict what actions another user of the code can perform. Compare the following Java class in which the name field has not been encapsulated: (en)
dcterms:subject
Wikipage page ID
Wikipage revision ID
Link from a Wikipage to another Wikipage
sameAs
dbp:wikiPageUsesTemplate
has abstract
  • In computer programming, field encapsulation involves providing methods that can be used to read from or write to the field rather than accessing the field directly. Sometimes these accessor methods are called getX and setX (where X is the field's name), which are also known as mutator methods. Usually the accessor methods have public visibility while the field being encapsulated is given private visibility - this allows a programmer to restrict what actions another user of the code can perform. Compare the following Java class in which the name field has not been encapsulated: public class NormalFieldClass { public String name; public static void main(String[] args) { NormalFieldClass example1 = new NormalFieldClass; example1.name = "myName"; System.out.println("My name is " + example1.name); }} with the same example using encapsulation: public class EncapsulatedFieldClass { private String name; public String getName { return name; } public void setName(String newName) { name = newName; } public static void main(String[] args) { EncapsulatedFieldClass example1 = new EncapsulatedFieldClass; example1.setName("myName"); System.out.println("My name is " + example1.getName); }} In the first example a user is free to use the public name variable however they see fit - in the second however the writer of the class retains control over how the private name variable is read and written by only permitting access to the field via its getName and setName methods. (en)
  • Інкапсуля́ція по́ля (англ. Encapsulate Field) — прийом рефакторингу, що дозволяє полегшити роботу з даними, покращити модульність частин програми та полегшити її підтримку. Забезпечує зближення даних і поведінки над цими даними. (uk)
prov:wasDerivedFrom
page length (characters) of wiki page
foaf:isPrimaryTopicOf
is Link from a Wikipage to another Wikipage of
is Wikipage redirect of
is foaf:primaryTopic of
Faceted Search & Find service v1.17_git139 as of Feb 29 2024


Alternative Linked Data Documents: ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3330 as of Mar 19 2024, on Linux (x86_64-generic-linux-glibc212), Single-Server Edition (62 GB total memory, 46 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software