logo

Understanding Data Encapsulation in Programming

   

Added on  2019-09-23

8 Pages2755 Words200 ViewsType: 200
 | 
 | 
 | 
Running Head: Blog WritingBlog Writing
Understanding Data Encapsulation in Programming_1

2Blog WritingData Encapsulation9th August, 2019What is Data Encapsulation?Data encapsulation can be defined as a mechanism of grouping the data and the functions of using such data and providing certain security aspects to control the access to such data. Sometimes, we get confused between data encapsulation and data abstraction. But both are quite different from each other. Data abstraction can be defined as a mechanism which exposes the interfaces and hides the implementation details from every user. Data encapsulation is an object-oriented programming which binds the functions manipulating the data and the data together and provides ample safety from third party interference and accessibility intending to prevent any kind of misuse. Data Hiding can also be considered as data encapsulation. Therefore, data encapsulation can also be termed as Data Hiding because this mechanism not only hides the implementation details of a particular class of data from the users but also restricts the access to any data class by the help of special functions which are termed as methods. The mechanism of wrapping of confidential and private data in groups or classes with the support of object-orientedprogramming languages is the mechanism of data encapsulation. The OSI model or Open Systems Interconnection model is also associated with data encapsulation. The OSI model is one of the conceptual models which standardizes and characterizes the communication processes of acomputing system or telecommunication without considering any technology for internal structural support. The main goal of this OSI model is to increase diverse communication interoperability. The object-oriented programming mechanism of data encapsulation helps in the binding group of related data properties along with other members and the functions which are necessary for data manipulation in a single unit. The group of data can be termed as the class which is highly used in the case of data encapsulation. This grouping helps in hiding details of any class of data from any kind of misuse or unauthorized access.
Understanding Data Encapsulation in Programming_2

3Blog WritingThe implementation details are hidden from the users. Encapsulation ensures the integrity of important data contained in an object. In this case, we should understand the true meaning of encapsulation and its relation to data. The main aim behind encapsulation is to preserve the privacy aspects of implementation details from unauthorized access or any kind of misuse. Encapsulation is itself an object-oriented programming mechanism which ensures protection to the private fields of the data classes along with the behaviours of such classes. An example can be used to explain data encapsulation. For example, in an office there can be several data related to the employees. We can create a class named "employee" where we can store several information such as job details, salary details, employee names, and other related information. These data can be grouped in a class which can be named as "employee". With the help of certain security functions, the implementation details and data properties can be hidden from unauthorised users. This is a mechanism which is object oriented programming mechanism and can be termed as data encapsulation. The office can create such classes to retrieve important information about its employees provided it protects direct access to search information by the users. The office can provide the access by using set name or get name methods. The user does not get any information about the process of implementation. The data encapsulation in this case can be observed to be achieved through the private fields and public methods of an object. In thisway, the office can make the data accessible by the users keeping the private fields and details ofimplementation hidden from other external classes and uses. This feature makes data encapsulation to be termed as Data Hiding. Access Modifiers or Access SpecifiersThere are certain access specifiers or access modifiers which can be used in implementing data encapsulation. The visibility and scope of a class member also gets defined by such access modifiers or access specifiers. In C#, there are five access modifiers which are used by encapsulation. These five modifiers include public, private, protected, internal, and protected internal modifiers. Access modifiers are also known as access specifiers. Specifiers are used in describing the accessibility scope of an object along with its members. Access specifiers are mainly used in controlling the accessibility scope of a member object of any particular class. If public access modifier is used former then access level is not prevented from the public. Access level can also be made restricted to the access to containing classes by using a protected
Understanding Data Encapsulation in Programming_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Data Encapsulation Concept
|3
|555
|285

Unpacking the Power of Data Encapsulation
|10
|2878
|302

Object Oriented Design for Genetic Algorithm Solver
|8
|1573
|93

System Analysis and Design
|7
|1556
|114

Assignment On Object Oriented Programming With Java
|4
|570
|40

Networking | OSI Model Layers - Study
|6
|1133
|23