Data abstraction is the means by which we lift the level of abstraction away from the machine (low-level) and closer to the application domain (high-level). As far as the machine is concerned, all data is binary, however the exact same binary representation can mean entirely different things within different contexts. Abstraction allows us to separate these contexts and thus give much greater meaning to the underlying representation.
Data abstraction relates to the concept that it is not necessary to know how an object works in order to use it. Data abstraction allows class designers to alter the underlying storage and implementation of their classes without affecting the consumers of those classes. Thus exposure to those changes can be limited to within the class itself. This is achieved by exposing an abstract interface to the consumers: so long as that interface remains the same, the consumers will be completely unaware any changes have taken place.
Note that data abstraction is often confused with data hiding. You cannot hide data in C++, you can only limit access to it. Data hiding is actually a function of binary libraries and executables, where physical data can be obfuscated.
Abstraction of data is a natural base for OOP. OOP deals with objects does not matter what kind of nature. In order to accomplish that, certain data should exist which could describe any other types in terms of its properties. Such data type is abstract data which can be any particular type.
Physical schemaDefines how data is storedConceptual schema or logical schemaDefines data in terms of a data modelExternal schema or view levelDefines a number of simplified domain-specific views
DBMS Levels of AbstractionAll data at the machine level is represented in binary. In some cases that data may very well represent an actual binary value, but in most cases it does not; it is the binary representation of something else entirely. A person's name, a floating point number, a shape: these are all abstractions that computer operators are much more familiar with. Data abstraction is the means by which these abstractions become more apparent to the user.
If we consider 24-bit RGB colour values, the binary representation for each colour is a 24-bit binary value. However, that value has three separate components, red, blue and green, each of which is represented by an 8-bit value. In order to create a colour we need to adjust these components individually, so it makes sense to represent them as separate components. We might initially consider using a 3-byte array:
const char black[3] = {0x00, 0x00, 0x00};
const char white[3] = {0xFF, 0xFF, 0xFF};
const char blue[3] = {0x00, 0x00, 0xFF};
This would work, however there's very little abstraction here. There's nothing to tell us that a char[3] data type is supposed to represent a 24-bit RGB value but when we pass a char[3] array to a function any notion of abstraction is completely stripped away because all arrays decay to pointers:
void f (const char* colour) {
// ...
}
Aside from the formal variable name, colour, there's nothing to tell us what a colour pointer variable should actually be referring to. At first glance we might assume we can pass a null-terminated C-style string into this function. Worse, any function that uses colours also needs to make use of the "magic number" 3. This is far too low-level to be in any way useful. It will work, but the onus is entirely upon the programmer to make it work.
In order to raise the level of abstraction, we should use a data structure, not an array:
struct RGB {
char red;
char blue;
char green;
};
At the machine-level there is no fundamental difference between an RGB data type and a char[3] data type. They are exactly the same length (3 bytes) and therefore equally efficient, but an RGB data type is much more meaningful to the programmer:
const RGB black = {0x00, 0x00, 0x00};
const RGB white = {0xFF, 0xFF, 0xFF};
const RGB blue = {0x00, 0x00, 0xFF};
void f (RGB colour) {
// ...
}
This is still relatively low-level because the implementation details are wholly visible, however knowing what is being represented by a data type gives us a much better idea of how to actually use the data type.
In this case, the RGB members have no invariant (they don't acquire any resources that need to be manually released), so it doesn't make sense to declare the data members private; it's not going to raise the level of abstraction. However, it would make sense to add some operator overloads to make it a little easier to work with. Inserting an RGB colour value into an output stream would certainly make debugging a bit easier:
std::ostream& operator<< (std::ostream& os, const RGB& colour) {
os << "RGB{" << colour.red << ", " << colour.green << ", " << colour.blue << "}";
return os;
}
Inserting a colour into a data file can also be catered for:
std::ofstream& operator<< (std::ofstream& ofs, const RGB& colour) {
ofs << colour.red << colour.green << colour.blue; return ofs; }
Given these operators, any code that uses them becomes that little bit more abstract:
void f (const RGB& colour, std::ofstream& ofs) {
std::cout << "saving colour value: " << colour << std:endl;
ofs << colour; }
Here the implementation details are much less apparent. The first writes the representation in a human-readable form while the latter writes the representation in the machine-readable form. Given the constant colour blue, the two outputs from this function would be:
saving colour value: RGB{0, 0, 255}
0x0000FF
Do we really need to know the implementation details in order to use these operators? Of course not. The abstractions alone have made these operators much more intuitive and the more intuitive something is the more likely we are to use it. More importantly, we haven't sacrificed performance or memory in any way; data abstraction is a programming tool, nothing more. However, if we can also present the data abstraction to the end-user, then so much the better. The first operator overload achieves that. The second does not but then again it was never intended to; it was solely intended to make life easier for the programmer, not the end-user.
Data abstraction refers to data hiding in OOPS . Data hiding is the hiding of data and and showing only the one you want to show . For example in a radio all wiring and system are covered by a plastic body .
Abstraction
Abstraction is simplifying complex reality by modelling classes appropriate to the problem, and working at the most appropriate level of inheritance for a given aspect of the problem.
For example, Lassie the Dog may be treated as a Dog much of the time, a Collie when necessary to access Collie-specific attributes or behaviors, and as an Animal (perhaps the parent class of Dog) when counting Timmy's pets.
Abstraction is also achieved through Composition. For example, a class Car would be made up of an Engine, Gearbox, Steering objects, and many more components. To build the Car class, one does not need to know how the different components work internally, but only how to interface with them, i.e., send messages to them, receive messages from them, and perhaps make the different objects composing the class interact with each other.
Data abstraction provides the skeleton or templates. That is it has no actual implementation.
hey whats up
Abstraction is a process by which higher concepts are derived from the usage and classification of literal ("real" or "concrete") concepts, first principles and/or other abstractions.
What is meant by resonance and explain the series and parallel resonance? by kathiresan
Drop Down list is the select option in which there are multiple options on drop down. It can be done by <select> tag in HTML.
An abstract in java is used to specify that the class/function is not yet complete. When a class in declared as abstract it means that it is not meant to be instantiated (you can't create variables of that type). This is because they are meant to be more of a guideline for other classes. When a class extends an abstract class it must either define all of the abstract methods from the abstract class or it must also be declared as an abstract class itself.
The concept of the Internet was developed during the Cold War. It was meant as a way for scientists and other "important" people to be able to connect and communicate using high-speed lines, no matter where they were.
abstraction of proton means removal of hydrogen because hydrogen leaves without its electrons so it is removed as a proton
Explain what is meant by a complex system
Explain what is meant by feedback
meaning of design concept in architecture
Explain what is meant by the term 'dementia.'
explain what is meant by a 5-1 setting system and explain whyn it could be successful
Explain what is meant by the fetch-execute cycle and describe its action in RLT?" Explain what is meant by the fetch-execute cycle and describe its action in RLT?"
Abstraction is a process by which higher concepts are derived from the usage and classification of literal ("real" or "concrete") concepts, first principles and/or other abstractions.
Customer,Cost,Communication
explain what is meant by "embedded control character" employed by a word processing package.
What is meant by resonance and explain the series and parallel resonance? by kathiresan
Google it.