Question

In: Computer Science

Give two advantages to hiding representation details using objects?

Give two advantages to hiding representation details using objects?

Solutions

Expert Solution

Definition for the concepts of data hiding:

Hiding representation details using objects can happen using the Abstraction concept in Object oriented programming language. Abstraction can be achieved using the concepts encapsulation and inheritance concepts.

Abstraction: It is a concept in which only the essential details are represented and non-essential details are hidden.

Encapsulation: In this concept the data is wrapped just like in a capsule and is hidden from all the other classes. This data can only be accessed by the methods that are defined in the same class.

Inheritance: In this a parent child relationship is being set between different objects. The child object acquires the properties of the parent object and can use the data and methods of the parent object all with its own data and methods.

Two advantages of hiding representation details using objects are:

  1. It reduces the complexity of the data that is used to represent the different objects. As it reduces complexity, it becomes easy to reuse the code, making it more efficient. Hiding helps to define the interfaces between different objects making it more easy to understand and readable and legible. It is easy to modify the data in the class as it does not affect the other objects as the objects are decoupled from each other. It helps in reducing the data redundancy as the data that is required in more than one object can be written once in an object and then it can be inherited by other objects as well by creating the parent-child relationship.

  1. As the data is hidden from the outside environment therefore it provides security to the data of that particular class as no other class is able to access that data until and unless the public access is provided to that data. Also as they are bundled in the same unit or the capsule called class, therefore it becomes easy to manage them and maintain them. The objects can be written once and can be used again and again on different platforms increasing their reusability.

Related Solutions

In JAVA, Briefly explain how objects are able to achieve both data hiding and implementation hiding.
In JAVA, Briefly explain how objects are able to achieve both data hiding and implementation hiding.
Which type of the constructional profiles may be utilized and give in details with its advantages...
Which type of the constructional profiles may be utilized and give in details with its advantages and disadvantages, respectively?
Please explain in details with some theory, what are the advantages or disadvantages of using social...
Please explain in details with some theory, what are the advantages or disadvantages of using social media as part of a brand strategy.
1. Give two examples of the limitations of the STRIPS representation for planning, i.e. things it...
1. Give two examples of the limitations of the STRIPS representation for planning, i.e. things it cannot represent or cannot easily represent. 2.   a. In what sense is branch-and-bound search similar to A* search?             b. In what sense is branch-and-bound search similar to depth-first search? 3. How does A* search extend best-first search? 4. If we have a search problem that does not involve costs, can we still use a heuristic function with A* in order to find the...
what are TWO advantages to using an EHR?
what are TWO advantages to using an EHR?
There are three caves, two of which contain dragons and one of which is a hiding...
There are three caves, two of which contain dragons and one of which is a hiding princess. The prince chooses a cave and a wizard (truthfully) reveals to the prince that one of the other caves has a dragon. 2 The prince now has the option to switch to the other cave (the one he didn’t choose and wasn’t revealed to have a dragon), and try his luck finding the princess in that cave instead. (a) Explain why the prince...
QUESTION BASED ON URBAN ECONOMICS. Using utility theory for transportation give a graphical representation when number...
QUESTION BASED ON URBAN ECONOMICS. Using utility theory for transportation give a graphical representation when number of vehicles on roads in a city stays fixed when there is an imposition of a congestion tax during peak period travel.
Give examples of Saudi companies that using ERP and what are the advantages of implementing the...
Give examples of Saudi companies that using ERP and what are the advantages of implementing the ERP? (write max 200 words with evidence in your own words) (2 Points)
Create a windows application that contains two TextBox objects and two Button objects. One of the...
Create a windows application that contains two TextBox objects and two Button objects. One of the TextBox objects and one of the buttons are initially invisible. The first textbox should be used to input a password. The textbox should be masked to some character of your choice so that the characters entered by the user are not seen on the screen. When the user clicks the first button, the second TextBox object and button object should be displayed with a...
1 - Explain these two terms: Secondary data and Primary data Then give two advantages and...
1 - Explain these two terms: Secondary data and Primary data Then give two advantages and disadvantages of each term (We are in marketing field)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT