What is the handle class?



What is the handle class?..

Answer / 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

More C++ General Interview Questions

Explain "const" reference arguments in function?

0 Answers  


What is the need of a destructor? Explain with the help of an example.

0 Answers  


What is a c++ class?

0 Answers  


Which function should be used to free the memory allocated by calloc()?

0 Answers  


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

4 Answers   Webyog,


What is class definition in c++ ?

0 Answers  


Generally variables are stored in heap memory. When he variables are created in stack?

4 Answers   Persistent,


advantages and disadvantages of using Borland C++ / version 5.

1 Answers  


structure contains int, char, float how it behaves for big endian and little endian?

1 Answers   BITS,


What is the best sorting algorithm, when there is a large amount of data, that cannot be fit in the main memory. ?

1 Answers   Yahoo,


Is there a sort function in c++?

0 Answers  


When do we run a shell in the unix system?

0 Answers  


Categories