answersLogoWhite

0


Best Answer

In procedural programming, we define a set of functions that will act upon a given set of data. However, the data and the functions that affect that data are actually quite separate, which can leave the data "exposed"; functions are free to alter the data without any regard to the actual type of data or what it represents. Ownership of the data is ambiguous at best. Without safeguards, the data could be invalidated at any time.

In structured programming we can organise the data and procedures in a more systematic fashion. However the data still required safeguards to maintain its validity.

With object-oriented programming we can combine small sets of data with the methods that can specifically modify that data into a single entity; an object. Each object is solely responsible for its own data, which can now be safely hidden from procedures that have no business accessing that data. Interfaces to the data can be designed such that the underlying data remains in a valid state at all times and access to the data and the functions that can modify the data can be strictly controlled by the object itself.

Users of objects do not need to know how an object physically stores its data, nor how it manipulates that data -- their only concern is to store the data, retrieve the data, and to modify the data. All of this is achieved by the interface exposed by the object. They need not concern themselves with the underlying implementation of that object, only that it does what it was intended to do in a highly predictable manner, nothing more and nothing less.

As with structured programming, complex data structures can be created by combining existing objects to create new objects. But since every object takes care of its own data, highly complex and robust structures that would otherwise be extremely difficult to implement become feasible.

An object that contains other objects needn't be concerned with how those objects actually work. For instance, a list object is not concerned with the type of data it can store, its only concern is to manage the node objects in the list, nothing more and nothing less. Similarly, the individual node objects have no concern for the type of data they contain, only that they have data the user can retrieve. By delegating jobs to the objects that actually know how to implement the work, the risk of invalidating data is greatly reduced.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the use of combining data and functions in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Functions use to describe large quantities of data?

Statistical function


How can graphs of polynomial functions show trends in data?

The way you can use graphs of polynomial functions to show trends in data is by comparing results between different functions. The alternation between the data will show the trends. Time can also be used to show the amount of variation.


What use of void data type in c plus plus?

doesn't return the value.


What are the functions of usbs?

There are many different functions, but the main one is data storage. You can use a USB to write and read data, this helps when moving data from one place to another, for example between school and home. I hope this helps.


Name the three functions that computers do over and over?

Computers perform several functions over and over that include processing. They transmit data repeatedly when in use. Computers continually store or save data.


What is use of user defined data in c?

to create user defined functions the user defined data is needed nd its useful to the programmer to create its own data.


Why use static data when you can use global data in the class in C plus plus?

Global data are used only as a last resort. It's highly recommended not use global data in your programs because sometimes it's really hard to avoid name clashing. And as result to track such problem down.


User defined data type in c plus plus?

Use "typedef" : both in C and C++.


How do you use adept in a sentence?

From Latin, ad (for) plus aptus (fit or qualified); combining form. Sentence use; 'she is very adept at swimming'; he is adept at math.


What are combining forms?

Combining forms are use in a sentences


What does raw math mean?

Raw math means a type of mathematics that employs the use of functions that accept raw data or primitive data as part of their parameters.


How can Excel summarize data in a range of data?

It can use functions like the SUM function or the SUBTOTAL function. Depending on what exactly the user wants to do, there are lots of functions that could be used to summarise the data.It can use functions like the SUM function or the SUBTOTAL function. Depending on what exactly the user wants to do, there are lots of functions that could be used to summarise the data.It can use functions like the SUM function or the SUBTOTAL function. Depending on what exactly the user wants to do, there are lots of functions that could be used to summarise the data.It can use functions like the SUM function or the SUBTOTAL function. Depending on what exactly the user wants to do, there are lots of functions that could be used to summarise the data.It can use functions like the SUM function or the SUBTOTAL function. Depending on what exactly the user wants to do, there are lots of functions that could be used to summarise the data.It can use functions like the SUM function or the SUBTOTAL function. Depending on what exactly the user wants to do, there are lots of functions that could be used to summarise the data.It can use functions like the SUM function or the SUBTOTAL function. Depending on what exactly the user wants to do, there are lots of functions that could be used to summarise the data.It can use functions like the SUM function or the SUBTOTAL function. Depending on what exactly the user wants to do, there are lots of functions that could be used to summarise the data.It can use functions like the SUM function or the SUBTOTAL function. Depending on what exactly the user wants to do, there are lots of functions that could be used to summarise the data.It can use functions like the SUM function or the SUBTOTAL function. Depending on what exactly the user wants to do, there are lots of functions that could be used to summarise the data.It can use functions like the SUM function or the SUBTOTAL function. Depending on what exactly the user wants to do, there are lots of functions that could be used to summarise the data.