Answer Posted / beena
A handle is a class that maintains a pointer to an object that is programmatically accessible through the public interface of the handle class.
Explanation:
In case of abstract classes, unless one manipulates the objects of these classes through pointers and references, the benefits of the virtual functions are lost. User code may become dependent on details of implementation classes because an abstract type cannot be allocated statistically or on the stack without its size being known. Using pointers or references implies that the burden of memory management falls on the user. Another limitation of abstract class object is of fixed size. Classes however are used to represent concepts that require varying amounts of storage to implement them.
A popular technique for dealing with these issues is to separate what is used as a single object in two parts: a handle providing the user interface and a representation holding all or most of the object's state. The connection between the handle and the representation is typically a pointer in the handle. Often, handles have a bit more data than the simple representation pointer, but not much more. Hence the layout of the handle is typically stable, even when the representation changes and also that handles are small enough to move around relatively freely so that the user needn’t use the pointers and the references.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can you Mention some Application of C/C++?
Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .
What is the difference between public, private, and protected access?
What is data abstraction? How is it different from data encapsulation?
What are destructors?
Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?
What is the most useful programming language?
What is #include math h in c++?
What type of question are asked in GE code writing test based on c++ data structures and pointers?
What are pointer-to-members in C++? Give their syntax.
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
What is a .h file c++?
What programming language should I learn first?
What do you understand by pure virtual function? Write about its use?
What is the copy-and-swap idiom?